tomwalters@0: % procedure for 'aim-mat' tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % tomwalters@0: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: bleeck@3: tomwalters@0: tomwalters@0: tomwalters@0: function [loadobject,type,options]=aim_loadfile(name) tomwalters@0: % load the nap and its options tomwalters@0: tomwalters@0: tomwalters@0: load(name); tomwalters@0: whodir=who; tomwalters@0: loadobject=[]; tomwalters@0: for i=1:length(whodir) tomwalters@0: if ~strcmp(whodir(i),'name') tomwalters@0: eval(sprintf('classstruct=%s.data;',whodir{i})); tomwalters@0: eval(sprintf('options=%s.options;',whodir{i})); tomwalters@0: try tomwalters@0: eval(sprintf('type=%s.type;',whodir{i})); tomwalters@0: catch tomwalters@0: type=[]; tomwalters@0: end tomwalters@0: if strcmp(whodir(i),'strobes') | strcmp(whodir(i),'strobestruct') | strcmp(whodir(i),'usermodule') tomwalters@0: loadobject=classstruct; tomwalters@0: else tomwalters@0: % construct the frame from whatever (sometimes the object is not recognised tomwalters@0: % as object due to the version ??) tomwalters@0: if isobject(classstruct) tomwalters@0: loadobject=classstruct; tomwalters@0: else tomwalters@0: nr=length(classstruct); tomwalters@0: if nr==1 tomwalters@0: switch type tomwalters@0: case 'sai' tomwalters@0: loadobject=frame(classstruct); tomwalters@0: case 'frame' tomwalters@0: loadobject=frame(classstruct); tomwalters@0: case 'spiral' tomwalters@0: loadobject=spiral(classstruct); tomwalters@0: otherwise tomwalters@0: loadobject=classstruct; tomwalters@0: end tomwalters@0: else tomwalters@0: for i=1:nr tomwalters@0: switch type tomwalters@0: case 'sai' tomwalters@0: loadobject{i}=frame(classstruct{i}); tomwalters@0: case 'frame' tomwalters@0: loadobject{i}=frame(classstruct{i}); tomwalters@0: case 'spiral' tomwalters@0: loadobject{i}=spiral(classstruct{i}); tomwalters@0: otherwise tomwalters@0: loadobject{i}=classstruct{i}; tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: