The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Output cell array
Replies: 3   Last Post: Nov 8, 2012 7:22 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Justin Ashmall

Posts: 20
Registered: 8/16/12
Re: Output cell array
Posted: Nov 8, 2012 7:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> 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:

Or take a look on the file exchange - I can see some functions there.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.