Changeset 2224


Ignore:
Timestamp:
09/14/09 07:14:16 (16 years ago)
Author:
Mathieu Morlighem
Message:

better error message of loadmodel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Model/loadmodel.m

    r1323 r2224  
    1313
    1414try,
    15         s=load(path,'-mat');
     15        struc=load(path,'-mat');
     16
    1617        %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]);
    1920        if ~strcmpi(class(md),'model'),
    2021                md2=model;
     
    2829                assignin('caller',fieldname,md);
    2930        end
    30 catch
     31catch me
     32        disp(getReport(me))
    3133        error(['could not load model ' path]);
    3234end
Note: See TracChangeset for help on using the changeset viewer.