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: Change the format of text file generated from MATLAB code
Replies: 5   Last Post: Feb 25, 2013 10:36 AM

Advanced Search

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

Posts: 10
Registered: 6/1/12
Re: Change the format of text file generated from MATLAB code
Posted: Feb 24, 2013 6:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


> You're not showing something then...
>

> >> format shorte
> >> x

> x =
> 6.9905e+01 8.0573e+01 7.9433e+01 8.0573e+01 7.9433e+01
> 6.9194e+01 8.3739e+01 7.9607e+01 8.3739e+01 7.9607e+01
> 7.0976e+01 8.1974e+01 7.8440e+01 8.1974e+01 7.8440e+01
> 7.5127e+01 7.9528e+01 7.7089e+01 7.9528e+01 7.7089e+01
> 7.7340e+01 8.0202e+01 7.7317e+01 8.0202e+01 7.7317e+01

> >> fid=fopen('test.dat','wt');
> >> fprintf(fid,[repmat('%8.3f',1,5) '\n'],x');
> >> fid=fclose(fid);
> >> type 'test.dat'

>
> 69.905 80.573 79.433 80.573 79.433
> 69.194 83.739 79.607 83.739 79.607
> 70.976 81.974 78.440 81.974 78.440
> 75.127 79.528 77.089 79.528 77.089
> 77.340 80.202 77.317 80.202 77.317
>

> >>
>
Thank you so much for the help. I appreciate it.



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.