load(filename)
st = load(filename)
load(filename, var1, ..., varN)
st = load(filename, var1, ..., varN)
load(filename, '-mat')
load(filename, '-nh5')
| Parameter | Description |
|---|---|
| filename | a string: .nh5 or .mat filename. |
| '-mat' or '-nh5' | forces to read file as nh5 or mat. |
| var1, ..., varN | string: Names of variables to load into Nelson's workspace. |
| Parameter | Description |
|---|---|
| st | a structure with variables name as fieldnames. |
load loads data from .nh5 or .mat file to Nelson's workspace.
Classdef objects saved by Nelson are restored as classdef objects when their class definition is available on the path.
A = ones(3, 4);
B = 'hello for open mat users';
save([tempdir(), 'example_load.mat'], 'A', 'B')
clear;
st = load([tempdir(), 'example_load.mat']);
who
st.A
st.B
clear
who
load([tempdir(), 'example_load.mat']);
who
A
B
clear classes
d = [tempdir(), 'nelson_help_load_classdef/'];
mkdir(d);
filewrite([d, '/NelsonHelpLoadPoint.m'], ["classdef NelsonHelpLoadPoint"; " properties"; " X = 0"; " Y = 0"; " end"; "end"]);
addpath(d);
point = NelsonHelpLoadPoint();
point.X = 7;
point.Y = 8;
filename = [tempdir(), 'nelson_help_load_classdef.nh5'];
save(filename, 'point');
clear point;
clear classes;
loaded = load(filename);
className = class(loaded.point)
coordinates = [loaded.point.X, loaded.point.Y]
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 2.0.0 | classdef object load behavior documented |