<< loadmat | MATIO | whomat >> |
savemat(filename) |
savemat(filename, version, var1, ..., varN) |
savemat(filename, '-append', ...) |
savemat(filename, '-nocompression', ...) |
a string: .nh5 filename.
string: Names of variables to save from Nelson's workspace.
default mat file used.
mat file version 7 used as output format.
mat file version 6 or 4 used as output format.
append variables to an existing .mat file (-v7.3 only).
disable .mat file compression.
savemat save workspace variables to .mat file.
Nelson's data types are converted into the Mat file equivalents.
A = ones(3, 4);
B = 'hello for open mat users';
savemat([tempdir(), 'example_loadmat.mat'], 'A', 'B')
clear;
st = loadmat([tempdir(), 'example_loadmat.mat']);
who
st.A
st.B
clear
who
loadmat([tempdir(), 'example_loadmat.mat']);
who
A
B
append variables
C = eye(3, 4);
savemat([tempdir(), 'example_loadmat.mat'], 'C', '-append')
clear;
st = loadmat([tempdir(), 'example_loadmat.mat']);
who
st.A
st.B
st.C
clear
who
loadmat([tempdir(), 'example_loadmat.mat']);
who
A
B
C
compression
C = eye(1000, 1000);
savemat([tempdir(), 'example_savemat_with_compression.mat'], 'C')
savemat([tempdir(), 'example_savemat_no_compression.mat'], 'C', '-nocompression')
with_compression = dir([tempdir(), 'example_savemat_with_compression.mat'])
no_compression = dir([tempdir(), 'example_savemat_no_compression.mat'])
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET