dhiraj
Posts:
10
Registered:
6/1/12
|
|
Re: Change the format of text file generated from MATLAB code
Posted:
Feb 24, 2013 4:46 PM
|
|
> Depends what you are using for output: > fid=fopen(txtfile,'wt'); > fprintf(fid,'%0.3f\n',out); % One per line > fclose(fid); > is one way to get what you want.
Thanks for your reply.
But when I use this, my text file loose the original data and gives me 112.000 101.000 114.000 109.000 120.000 50.000 54.000 50.000 54.000 46.000 105.000 110.000 99.000, these random numbers.
I also tried using above code in the code, where I am actually generating the file, though it displays numbers in the format I want, but in the saved text file they are still in the format of 6.89000+002.
|
|