annotate aim-mat/gui/aim_loadfile.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % procedure for 'aim-mat'
tomwalters@0 2 %
tomwalters@0 3 % INPUT VALUES:
tomwalters@0 4 %
tomwalters@0 5 % RETURN VALUE:
tomwalters@0 6 %
tomwalters@0 7 %
bleeck@3 8 %
tomwalters@0 9 % (c) 2011, University of Southampton
bleeck@3 10 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 11 % download of current version is on the soundsoftware site:
bleeck@3 12 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 13 % documentation and everything is on http://www.acousticscale.org
bleeck@3 14
bleeck@3 15
tomwalters@0 16
tomwalters@0 17
tomwalters@0 18 function [loadobject,type,options]=aim_loadfile(name)
tomwalters@0 19 % load the nap and its options
tomwalters@0 20
tomwalters@0 21
tomwalters@0 22 load(name);
tomwalters@0 23 whodir=who;
tomwalters@0 24 loadobject=[];
tomwalters@0 25 for i=1:length(whodir)
tomwalters@0 26 if ~strcmp(whodir(i),'name')
tomwalters@0 27 eval(sprintf('classstruct=%s.data;',whodir{i}));
tomwalters@0 28 eval(sprintf('options=%s.options;',whodir{i}));
tomwalters@0 29 try
tomwalters@0 30 eval(sprintf('type=%s.type;',whodir{i}));
tomwalters@0 31 catch
tomwalters@0 32 type=[];
tomwalters@0 33 end
tomwalters@0 34 if strcmp(whodir(i),'strobes') | strcmp(whodir(i),'strobestruct') | strcmp(whodir(i),'usermodule')
tomwalters@0 35 loadobject=classstruct;
tomwalters@0 36 else
tomwalters@0 37 % construct the frame from whatever (sometimes the object is not recognised
tomwalters@0 38 % as object due to the version ??)
tomwalters@0 39 if isobject(classstruct)
tomwalters@0 40 loadobject=classstruct;
tomwalters@0 41 else
tomwalters@0 42 nr=length(classstruct);
tomwalters@0 43 if nr==1
tomwalters@0 44 switch type
tomwalters@0 45 case 'sai'
tomwalters@0 46 loadobject=frame(classstruct);
tomwalters@0 47 case 'frame'
tomwalters@0 48 loadobject=frame(classstruct);
tomwalters@0 49 case 'spiral'
tomwalters@0 50 loadobject=spiral(classstruct);
tomwalters@0 51 otherwise
tomwalters@0 52 loadobject=classstruct;
tomwalters@0 53 end
tomwalters@0 54 else
tomwalters@0 55 for i=1:nr
tomwalters@0 56 switch type
tomwalters@0 57 case 'sai'
tomwalters@0 58 loadobject{i}=frame(classstruct{i});
tomwalters@0 59 case 'frame'
tomwalters@0 60 loadobject{i}=frame(classstruct{i});
tomwalters@0 61 case 'spiral'
tomwalters@0 62 loadobject{i}=spiral(classstruct{i});
tomwalters@0 63 otherwise
tomwalters@0 64 loadobject{i}=classstruct{i};
tomwalters@0 65 end
tomwalters@0 66 end
tomwalters@0 67 end
tomwalters@0 68 end
tomwalters@0 69 end
tomwalters@0 70 end
tomwalters@0 71 end
tomwalters@0 72
tomwalters@0 73
tomwalters@0 74