Ignore:
Timestamp:
12/18/19 15:46:35 (5 years ago)
Author:
bduin
Message:
 
Location:
prdatasets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • prdatasets

    • Property svn:ignore
      •  

        old new  
        33*.data
        44*.asv
         5data
  • prdatasets/pr_getdata.m

    r132 r137  
    1010% If given, SIZE (in MByte) is displayed in the request.
    1111%
    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.
    1718%
    1819% This is a low-level routine, typically used in COMMAND and not called
     
    2021% is constucted and returned to the user.
    2122%
    22 % SEE ALSO DATASETS, DATAFILES
     23% SEE ALSO (<a href="http://37steps.com/prhtml/37tools.html">37tools Contents</a>)
     24% DATASETS, DATAFILES
    2325
    24 % Copyright: R.P.W. Duin
     26% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
    2527
    2628function out = pr_getdata(varargin)
     
    3335%  dset  : becomes full path and name of dataset
    3436%  ddir  : becomes full path of dataset
    35 name = callername;
     37name = pr_callername;
    3638argin = setdefaults(varargin,[],[],[],[],true);
    3739[url,size,dset,field,ask] = deal(argin{:});
     40
     41if isempty(url)
     42  url = ['http://prtools.tudelft.nl/prdatasets/' name '.mat'];
     43end
    3844[dummy,uname,ext] = fileparts(url);
    3945
     
    4147  ddir = pwd;
    4248else
    43   ddir = fileparts(which(name));
     49  ddir = fullfile(fileparts(which(name)),'data');
    4450end
    4551
     
    117123  try
    118124    s = prload(dsetmat);
    119   catch
     125  catch ME
    120126    out = 'error';
    121127    return
     
    143149end
    144150
    145 function name = callername
    146 [ss,dummy] = dbstack;
    147 if length(ss) < 3
    148         name = [];
    149 else
    150         name = ss(3).name;
    151 end
    152151
    153152
Note: See TracChangeset for help on using the changeset viewer.