print a matrix in output file

7 ビュー (過去 30 日間)
Ayda
Ayda 2011 年 10 月 31 日
Good morning\evening
I tried to print a result matrix R in an output file.
fprintf(fid,'%.3f\t\n %.3f\t\n %.3f\t\n',R);
Actually, the output prints the matrix row by row.
Can you help me?
Regards, Ayda

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 31 日
Each of the \n in the formats indicates that you want to start a new line.
The \t you have indicate that you want a tab before the newline; that would be somewhat unusual.
Anyhow, you should use R.' (the transpose of R) as the argument to fprintf() instead of just R
  3 件のコメント
Ayda
Ayda 2011 年 10 月 31 日
sorry i did not notice that you say .'
Thanks alot
its works =)

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by