Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Output cell array
Posted:
Nov 8, 2012 7:22 AM
|
|
> outvec={64927 3051114511.00000 5.11772042811932e-10 1953994975.00000 'string'} > > Tried using save function. > >> save 'output.txt' outvec -ascii >
It's not much help, but this is expected. From "doc save" for ascii files: * Each variable must be a two-dimensional double or character array.
i.e. cell arrays are not supported.
In general, saving a cell array that contains mixed numbers and strings is not particularly simple in MATLAB. Your best best is to store the numbers and strings in separate arrays, and then use save() or dlmwrite() for example.
If you want to use a mixed cells array, try reading this for an example: http://www.mathworks.com/help/matlab/import_export/write-to-delimited-data-files.html#br2ypq2-1
Or take a look on the file exchange - I can see some functions there.
Justin
|
|
|
|