the priority and benefits of saving data in .mat file

13 ビュー (過去 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 Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by