How do I write to a .txt file?

回答 (2 件)

Walter Roberson
Walter Roberson 2014 年 1 月 25 日

1 投票

fid = fopen('YourFile.txt', 'wt');
fprintf(fid, 'Jake said: %f\n', sqrt(1:10));
fclose(fid);
G PRAKASH
G PRAKASH 2014 年 1 月 25 日

0 投票

use dlmwrite command
I=magic(10); dlmwrite('file.txt',I)

質問済み:

2014 年 1 月 25 日

回答済み:

2014 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by