save
Save variables into a MAT file.
Syntax
save(filename, variables)
save(filename, variables, format)
save(filename)
save(filename, format)
save filename
Inputs
- filename
- Path and name of the MAT file to read.
- variable
- List of the variables to save, separated by a comma.
- format
- Specifies the format of the file to save. If omitted, format 7.3 is assumed.
Example
% create some string
st='hello';
% create a matrix
M = [ 1923.71288 4023.03575 9768.82832 9195.83701 104.13143 4261.35201 ];
% save to file
save('file.mat')
% save only the matrix to file
save('file.mat','M')
% save only the matrix to file, with v5 format
save('file.mat','M','-v5')