creating a new file

조회 수: 76 (최근 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 CenterFile Exchange에서 Programming Utilities에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by