• Uncategorised

save

SAVE Save workspace variables to disk.
SAVE FILENAME saves all workspace variables to the binary “MAT-file”
named FILENAME.mat. The data may be retrieved with LOAD. If FILENAME
has no extension, .mat is assumed.

SAVE, by itself, creates the binary “MAT-file” named ‘matlab.mat’. It is
an error if ‘matlab.mat’ is not writable.

SAVE FILENAME X saves only X.
SAVE FILENAME X Y Z saves X, Y, and Z. The wildcard ‘*’ can be used to
save only those variables that match a pattern.

ASCII Options:
SAVE … -ASCII uses 8-digit ASCII form instead of binary regardless
of file extension.
SAVE … -ASCII -DOUBLE uses 16-digit ASCII form.
SAVE … -ASCII -TABS delimits with tabs.
SAVE … -ASCII -DOUBLE -TABS 16-digit, tab delimited.

MAT Options:
SAVE … -MAT saves in MAT format regardless of extension.
SAVE … -V4 saves a MAT-file that MATLAB 4 can LOAD.
SAVE … -APPEND adds the variables to an existing file (MAT-file only).

When using the -V4 option, variables that incompatible with MATLAB 4 are
not saved to the MAT-file. For example, ND arrays, structs, cells, etc.
cannot be saved to a MATLAB 4 MAT-file. Also, variables with names that
are longer than 19 characters cannot be saved to a MATLAB 4 MAT-file.

Use the functional form of SAVE, such as SAVE(‘filename’,’var1′,’var2′),
when the filename or variable names are stored in strings.

See also LOAD, DIARY, FWRITE, FPRINTF, UISAVE, FILEFORMATS.

Overloaded methods
help activex/save.m

You may also like...