필터 지우기
필터 지우기

Save data to .mat file

조회 수: 7 (최근 30일)
Hazel Sialongo
Hazel Sialongo 2016년 9월 27일
댓글: Hazel Sialongo 2016년 9월 27일
How can I save data to a mat file? I just want to create 10 column mat file. I also want column headings in the first row of each column.

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 27일
Once you had created the table described there, you can save() it to a .mat file.
Are you trying to create a text output file or a binary output file?
If you are trying to save to a text file with column headers, then really the best way is to fopen(), fprintf() the headers, fprintf() the data, and then fclose().
If you are trying to save to a text file with column headers, and you really feel a need to use save, then use fopen(), fprintf() the headers, fclose(). Then use
save TheMatFileName -ascii -tabs -append TheVariableName
If you are trying to save in binary form and you need column headers then you need to use a table() object (described in the link above), or you need to use a dataset() object from the Statistics toolbox. Those are the only kinds of rectangular arrays that support column headers.
  댓글 수: 1
Hazel Sialongo
Hazel Sialongo 2016년 9월 27일
I've just got an answer to this. But anyway, thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by