NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/util/loadname.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 % [array]=loadname(filename)
2 % load filename and save data back with name array.
3 function [array]=loadname(filename)
4 %
5 load(filename);
6 %
7 slashes=find(filename(1,:)=='/');
8 if isempty(slashes)==1;
9    is=1;
10 else
11    is=slashes(length(slashes))+1;
12 end
13 %
14 dots=find(filename(1,is:length(filename))=='.');
15 if isempty(dots)==1;
16    ie=length(filename);
17 else
18    ie=is+dots(1)-2;
19 end
20 %
21 %filename(is)
22 if(~isempty(str2num(filename(is))))
23 array=eval([filename(is+1:ie)]);
24 else
25 array=eval(filename(is:ie),filename(is+1:ie));
26 end
Note: See TracBrowser for help on using the browser.