1 function comsol_load(load_name)
2 %
function comsol_load(load_name)
4 % Loads saved (comsol) data from a file. The filename is given in 'loadname'.
5 % There must exist two files: load_name.mat and load_name_cmodel.mph
6 % See also comsol_save.m
8 %Oliver Zeeb, 2012/11/30
10 %load all the variables in this local funtion and add the comsol_model to
11 %those structures, which shall contain it!
14 cmodel_temp = mphload([load_name,'_cmodel.mph']);
15 for k=1:length(varnames)
16 if isstruct(eval(varnames{k}))
17 if isfield(eval(varnames{k}),
'comsol_model')
18 eval([varnames{k},
'.comsol_model = cmodel_temp;']);
23 %assign the data in the caller-workspace
24 for k=1:length(varnames)
25 assignin('caller',varnames{k}, eval(varnames{k}));
28 %deletes the
string containing the load name
29 evalin(
'caller',
'clear load_name;');