From: pietro on
I have a string that contains a numerical matrix, in which between two rows there are a delimiter and between tow columns there are another delimiter. Is it possible to convert that matrix in numerical matrix giving the delimiter between rows and columns?
From: Walter Roberson on
pietro wrote:
> I have a string that contains a numerical matrix, in which between two
> rows there are a delimiter and between tow columns there are another
> delimiter. Is it possible to convert that matrix in numerical matrix
> giving the delimiter between rows and columns?


>> str2num('[1,2;3,4]')
ans =
1 2
3 4

The rest is just string manipulation to replace your existing delimiters into
commas and semi-colons. And possibly a transpose() if the string is in
column-major order instead of row-major order.