the priority and benefits of saving data in .mat file

조회 수: 9 (최근 30일)
farzad
farzad 2014년 10월 10일
편집: Bruno Pop-Stefanov 2014년 10월 10일
Hi All
I would like to know, why would it be beneficial to use .mat files to save data to when it's very hard to review them at any time, and should always be loaded and also it can be written to mfile directly
I appreciate your attention

채택된 답변

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 10월 10일
편집: Bruno Pop-Stefanov 2014년 10월 10일
MAT files are compressed, binary files used to store data on the computer's hard drive. It is a convenient way to save data for future use and for sharing.
You can see the contents of the MAT file without loading it in the memory. Simply click on the MAT file in the Current Folder browser and the contents will be displayed below.
You can also load only one variable from a MAT file containing several variables with a simple command, without needing to load the entire file:
>> load mymatfile.mat variable
You can add variables to a MAT file gradually, when a MAT file already exists and already contains data. There is no need to re-write everything from the beginning:
>> save mymatfile.mat variable
If you don't want to use MAT file, the other alternative is to write the data to a binary file or a text file using the fprintf or fwrite functions, but it is obviously not as convenient as using MAT file. You would have to write your own read and write routines and the files will not be compressed.
For more information, you can refer to the following documentation page, which lists functions and tutorials for dealing with variables and MAT files:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by