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', 'paramnames', 'paramvalues'};
0032
0033 otherfields = {'mmats' 'amats_handles' 'bmats_handles' 'cmats_handles' 'dmats_handles'...
0034 'inputvarnames' 'ssvarnames' 'ssini' 'outputvarnames' 'paramsigmas'};
0035
0036 for f = userfields
0037 if isparam(pl(i_pl), f{1})
0038 sys.(f{1}) = find(pl(i_pl),f{1});
0039 else
0040 display(['### ERROR : field in ssm named ''',f{1},''' must be user defined ###']);
0041 display('### list of other compulsory user defined fields ###')
0042 display(char(userfields))
0043 display('### list of other optional user defined fields ###')
0044 display(char(otherfields))
0045 error(['see above message and lists ^^ ']);
0046 end
0047 end
0048
0049 for f = otherfields
0050 if isparam(pl(i_pl),f{1})
0051 sys.(f{1}) = find(pl(i_pl),f{1});
0052 end
0053 end
0054
0055 sys.addHistory(ssm.getInfo('ssm', 'From Description'), pli, {''}, []);
0056
0057 end
0058 end