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: Save strings and numbers together
Replies: 4   Last Post: Mar 14, 2013 9:53 AM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: Save strings and numbers together
Posted: Mar 14, 2013 9:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 3/14/2013 7:14 AM, Phil Roberts wrote:

> How do I increase the number of output columns in fprintf if "val" is
> changing each time? For example:


> I would like to add the %5.3f for each additional column in val
> automatically.

fmt=[repmat('%5.3f ',1,size(val,2)) '\n'];

Salt to suit...NB the transpose operator on the array to output in row
order rather than internal column storage order.


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.