Changeset 127 for trunk/src/nc2struct.m
- Timestamp:
- Nov 19, 2010, 10:44:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/nc2struct.m
r100 r127 98 98 if ischar(valuestr) && length(valuestr)<200 99 99 iatt_g=iatt_g+1; 100 indstr1=regexp(keystr,'\\' );%detect '\\'101 indstr2=regexp(keystr,'\.' );%detect '\.'100 indstr1=regexp(keystr,'\\','once');%detect '\\' 101 indstr2=regexp(keystr,'\.','once');%detect '\.' 102 102 if isempty(indstr1) && isempty(indstr2) 103 103 eval(['Data.' keystr '=''' valuestr ''';']) … … 228 228 %select the used dimensions 229 229 if ~isempty(var_read) 230 % if isfield(Data,'ListDimName') %&& isfield(Data,'DimValue')231 % Data=rmfield(Data,'ListDimName');232 % %Data=rmfield(Data,'DimValue');233 % end234 % else235 % list_dim=1:ndims;236 230 dim_index=find(flag_used); 237 % list_dim=list_dim(dim_index);238 231 old2new=cumsum(flag_used); 239 232 ListDimName=ListDimName(dim_index); … … 241 234 end 242 235 for ivar=1:length(var_read) 243 %Data.VarDimIndex{ivar}=old2new(VarDimIndex{ivar});% ENLEVER Data.VarDimIndex ulterieurement244 %Data.VarDimName{ivar}=Data.ListDimName(Data.VarDimIndex{ivar});245 236 Data.VarDimName{ivar}=ListDimName(old2new(VarDimIndex{ivar})); 246 237 end … … 257 248 end 258 249 eval(['Data.' VarName '=double(netcdf.getVar(nc,var_index(ivar)-1));'])%read the variable data 259 %eval(['siz=size(Data.' VarName ');'])260 % if numel(siz)<=2261 %eval(['Data.' VarName '=Data.' VarName ''';'])%read the variable data262 %end263 250 end 264 251 end
Note: See TracChangeset
for help on using the changeset viewer.