0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 function sys = ssmFromDescription(pli)
0019 utils.helper.msg(utils.const.msg.MNAME, ['running ', mfilename]);
0020
0021
0022 pl = combine(pli, ssm.getDefaultPlist('From Description'));
0023 if ~isa(pl,'plist')
0024 error(['error because input is not a plist but a ', class(pl)]);
0025 end
0026
0027 sys(length(pl) ) = ssm;
0028 for i_pl = 1:length(pl)
0029
0030 userfields = {'name','ssnames', 'outputnames', 'inputnames', 'timestep', 'amats', ...
0031 'bmats', 'cmats', 'dmats'};
0032
0033 otherfields = {'mmats' 'amats_handles' 'bmats_handles' 'cmats_handles' 'dmats_handles'...
0034 'inputvarnames' 'ssvarnames' 'outputvarnames' ...
0035 'paramnames' 'paramvalues' 'paramsigmas'};
0036
0037 for f = userfields
0038 if isparam(pl(i_pl), f{1})
0039 sys(i_pl).(f{1}) = find(pl(i_pl),f{1});
0040 else
0041 display(['### ERROR : field in ssm named ''',f{1},''' must be user defined ###']);
0042 display('### list of other compulsory user defined fields ###')
0043 display(char(userfields))
0044 display('### list of other optional user defined fields ###')
0045 display(char(otherfields))
0046 error(['see above message and lists ^^ ']);
0047 end
0048 end
0049
0050 for f = otherfields
0051 if isparam(pl(i_pl),f{1})
0052 sys(i_pl).(f{1}) = find(pl(i_pl),f{1});
0053 end
0054 end
0055
0056 sys(i_pl).addHistory(ssm.getInfo('ssm', 'From Description'), pli(i_pl), {''}, []);
0057
0058 end
0059 end