Changeset 137 for prdatasets/pr_getdata.m
- Timestamp:
- 12/18/19 15:46:35 (5 years ago)
- Location:
- prdatasets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
prdatasets
- Property svn:ignore
-
old new 3 3 *.data 4 4 *.asv 5 data
-
- Property svn:ignore
-
prdatasets/pr_getdata.m
r132 r137 10 10 % If given, SIZE (in MByte) is displayed in the request. 11 11 % 12 % If available, the dataset DSET stored in FIELD is returned in OUT. 13 % In case of a datafile DFILE, it is created, if necessary, with given TYPE 14 % and returned in OUT. In case the download was successful but no dataset 15 % or datfile could be created (e.g. because of empty TYPE) OUT is empty, 16 % otherwise an error is generated. 12 % A mat-file returns a structure with fields pointing to stored variables. 13 % If available, the dataset DSET stored in FIELD (default 1) is returned in 14 % OUT. In case of a datafile DFILE, it is created, if necessary, with given 15 % TYPE and returned in OUT. In case the download was successful but no 16 % dataset or datfile could be created (e.g. because of empty TYPE) OUT is 17 % empty, otherwise an error is generated. 17 18 % 18 19 % This is a low-level routine, typically used in COMMAND and not called … … 20 21 % is constucted and returned to the user. 21 22 % 22 % SEE ALSO DATASETS, DATAFILES 23 % SEE ALSO (<a href="http://37steps.com/prhtml/37tools.html">37tools Contents</a>) 24 % DATASETS, DATAFILES 23 25 24 % Copyright: R.P.W. Duin 26 % Copyright: R.P.W. Duin, r.p.w.duin@37steps.com 25 27 26 28 function out = pr_getdata(varargin) … … 33 35 % dset : becomes full path and name of dataset 34 36 % ddir : becomes full path of dataset 35 name = callername;37 name = pr_callername; 36 38 argin = setdefaults(varargin,[],[],[],[],true); 37 39 [url,size,dset,field,ask] = deal(argin{:}); 40 41 if isempty(url) 42 url = ['http://prtools.tudelft.nl/prdatasets/' name '.mat']; 43 end 38 44 [dummy,uname,ext] = fileparts(url); 39 45 … … 41 47 ddir = pwd; 42 48 else 43 ddir = f ileparts(which(name));49 ddir = fullfile(fileparts(which(name)),'data'); 44 50 end 45 51 … … 117 123 try 118 124 s = prload(dsetmat); 119 catch 125 catch ME 120 126 out = 'error'; 121 127 return … … 143 149 end 144 150 145 function name = callername146 [ss,dummy] = dbstack;147 if length(ss) < 3148 name = [];149 else150 name = ss(3).name;151 end152 151 153 152
Note: See TracChangeset
for help on using the changeset viewer.