Changeset 151 for prdatasets/pr_getdata.m
- Timestamp:
- 01/11/20 00:14:42 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prdatasets/pr_getdata.m
r150 r151 11 11 % 12 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 13 % If available, the dataset DSET stored in FIELD is returned in OUT. If 14 % FIELD is not set all fields are returned in a cell array. 15 % 16 % In case of a datafile DFILE, it is created, if necessary, with given 15 17 % TYPE and returned in OUT. In case the download was successful but no 16 18 % dataset or datfile could be created (e.g. because of empty TYPE) OUT is … … 127 129 if exist([dsetmat],'file') == 2 128 130 try 129 s = prload(dsetmat);131 out = file2dset(dsetmat); 130 132 catch ME 131 out = 'error'; 132 return 133 end 134 if isstruct(s) 135 if isempty(field) 136 f = fieldnames(s); 137 out = getfield(s,f{1}); 133 s = load(dsetmat); 134 if isstruct(s) 135 if isempty(field) 136 s = struct2cell(s); 137 out = s{1}; 138 else 139 out = getfield(s,field); 140 end 138 141 else 139 out = getfield(s,field);142 out = s; 140 143 end 141 else142 out = s;143 144 end 144 145 elseif exist(dset,'dir') == 7
Note: See TracChangeset
for help on using the changeset viewer.