Changeset 382 for trunk/src/check_field_structure.m
- Timestamp:
- Feb 6, 2012, 11:46:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/check_field_structure.m
r159 r382 58 58 return 59 59 end 60 eval(['sizvar=size(Data.' VarName ');'])% sizvar = dimension of variable60 sizvar=size(Data.(VarName));% sizvar = dimension of variable 61 61 DimCell=Data.VarDimName{ivar}; 62 62 if ischar(DimCell) … … 65 65 errormsg=['wrong format for .VarDimName{' num2str(ivar) ' (must be the cell of dimension names of the variable ' VarName]; 66 66 return 67 67 68 end 68 69 nbcoord=numel(sizvar);%nbre of coordinates for variable named VarName … … 91 92 else 92 93 if numel(DimCell)>nbcoord 93 DimCell=DimCell(end-nbcoord+1:end);%first singleton diemensions omitted, 94 sizvar(nbcoord+1:numel(DimCell))=1;% case of singleton dimensions (not seen by the function size) 95 % DimCell=DimCell(end-nbcoord+1:end)%first singleton diemensions omitted, 94 96 elseif nbcoord > numel(DimCell) 95 97 errormsg=['nbre of declared dimensions in .VarDimName{' num2str(ivar) '} smaller than the nbre of dimensions =' num2str(nbcoord) ' of the variable ' VarName]; … … 98 100 end 99 101 DimIndex=[]; 100 for idim=1:nbcoord %loop on the coordinates of variable #ivar 102 %for idim=1:nbcoord 103 for idim=1:numel(DimCell) %loop on the coordinates of variable #ivar 101 104 DimName=DimCell{idim}; 102 105 iprev=find(strcmp(DimName,Data.ListDimName),1);%look for dimension name DimName in the current list … … 112 115 else % DimName is detected in the current list of dimension names 113 116 if ~isequal(Data.DimValue(iprev),sizvar(idim)) 117 Data.DimValue(iprev) 118 sizvar(idim) 114 119 if isequal(Data.DimValue(iprev),2)&& RangeTest(iprev) % the dimension has been already detected as a range [min max] 115 120 Data.DimValue(iprev)=sizvar(idim); %update with actual value
Note: See TracChangeset
for help on using the changeset viewer.