matlab's fortran's format equivalents

Posted by ldigas on Stack Overflow See other posts from Stack Overflow or by ldigas
Published on 2010-05-01T20:36:31Z Indexed on 2010/05/01 21:27 UTC
Read the original article Hit count: 162

Filed under:
|

What would be matlab's equivalent of

write(1,'("Speed, resistance, power",3f8.2)')(a(i),i=1,3)

I've tried

a = [10. 20. 200.]
fprintf(unit1,'a = 3%8.1e',a)

but I'm still having trouble with it (the whole matlab output formatting thing).


Edit for Kenny: for the values of a as given above, it would give (in a new row):

Speed, resistance, power   10.00   20.00  200.00

© Stack Overflow or respective owner

Related posts about matlab

Related posts about fortran