save(
saves all variables from the current workspace in a MATLAB® formatted binary file (MAT-file) called filename
)filename
. If filename
exists, save
overwrites the file.
save test.mat X % command form save('test.mat','X') % function form
p = rand(1,10); q = ones(10); save('pqfile.txt','p','q','-ascii')
a = 50; save('test.mat','a','-append')
Value of fmt | File Format |
---|---|
'-mat' | Binary MAT-file format. |
'-ascii' | Text format with 8 digits of precision. |
'-ascii','-tabs' | Tab-delimited text format with 8 digits of precision. |
'-ascii','-double' | Text format with 16 digits of precision. |
'-ascii','-double','-tabs' | Tab-delimited text format with 16 digits of precision. |