Changeset 12648
- Timestamp:
- 07/18/12 10:23:24 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/organizer.m
r12365 r12648 69 69 end 70 70 %}}} 71 function md=load(org,string),% {{{ 72 73 %Get model path 74 if ~ischar(string), error('argument provided is not a string'); end 75 path=[org.repository '/' org.prefix string]; 76 77 %figure out if the model is there 78 if exist(path,'file'), 79 struc=load(path,'-mat'); 80 name=char(fieldnames(struc)); 81 md=struc.(name); 82 if nargout, 83 varargout{1}=md; 84 end 85 else 86 error(['Could not find ' path ]); 87 end 88 end%}}} 71 89 function md=loadmodel(org,string),% {{{ 72 90 … … 76 94 77 95 %figure out if the model is there, otherwise, we have to use the default path supplied by user. 78 if exist(path,'file') ,96 if exist(path,'file') | exist([path '.mat'],'file'), 79 97 md=loadmodel(path); 80 98 return; … … 139 157 140 158 %check that md is a model 141 if ~isa(md,'model'), error('savemodel error message:third argument is not a model'); end159 if ~isa(md,'model'), warning('third argument is not a model'); end 142 160 if (org.currentstep>length(org.steps)), error(['organizer error message: element with id ' num2str(org.currentstep) ' not found']); end 143 161
Note:
See TracChangeset
for help on using the changeset viewer.