Changeset 2224
- Timestamp:
- 09/14/09 07:14:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/Model/loadmodel.m
r1323 r2224 13 13 14 14 try, 15 s=load(path,'-mat'); 15 struc=load(path,'-mat'); 16 16 17 %get name of model variable 17 fieldname=char(fieldnames(s ));18 md=eval(['s .' fieldname]);18 fieldname=char(fieldnames(struc)); 19 md=eval(['struc.' fieldname]); 19 20 if ~strcmpi(class(md),'model'), 20 21 md2=model; … … 28 29 assignin('caller',fieldname,md); 29 30 end 30 catch 31 catch me 32 disp(getReport(me)) 31 33 error(['could not load model ' path]); 32 34 end
Note:
See TracChangeset
for help on using the changeset viewer.