creating a new file

67 ビュー (過去 30 日間)
Win Thomas Halim
Win Thomas Halim 2011 年 5 月 4 日
コメント済み: Walter Roberson 2026 年 1 月 16 日 20:13
hi there, anyone know hot to save results to a file in matlab?(i.e. create new file) suppose i had this x,y,z data that i want to save it as "results.str" that is openable via notepad. i really need help here! anyone can help? thank you very much.
  2 件のコメント
Anjali
Anjali 2026 年 1 月 16 日 9:15
how to create a new file in matlab
Walter Roberson
Walter Roberson 2026 年 1 月 16 日 20:13
What do you want to have happen if there happens to be an existing file of the same name?

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

採用された回答

Oleg Komarov
Oleg Komarov 2011 年 5 月 4 日
Create new file discarding content if already exists:
fid = fopen('results.str','w');
fprintf(fid,'%f,%f,%f\r\n',[1 2 3; 4 5 6].');
fid = fclose(fid);
  2 件のコメント
Robert Cumming
Robert Cumming 2011 年 5 月 4 日
編集済み: Walter Roberson 2026 年 1 月 16 日 20:12
to add to Olegs answer you can add the following line to view the file in notepad:
system ( 'notepad results.str' )
Hamza
Hamza 2023 年 11 月 30 日
Right

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming Utilities についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by