Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: fprintf in a loop
Replies: 2   Last Post: May 5, 2013 5:59 AM

Advanced Search

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

Posts: 42
Registered: 10/8/09
fprintf in a loop
Posted: May 4, 2013 10:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I want to have the output as below
1 & $3 $ & $ 4 $ & $ 5 $ & $ 6 $ & $7 $ \\

through fprintf using specification sth like below however, it doesn't work at all....
vector=[3 4 5 6 7 ]
for w=1:length(vector)
fprintf(fid, '%s &$', vector(w), '$');
end

can anyone help me about this a bit? thanks




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.