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.11772042811932e10 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 twodimensional 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/writetodelimiteddatafiles.html#br2ypq21
Or take a look on the file exchange  I can see some functions there.
Justin



