Changeset 382 for trunk/src/struct2nc.m
- Timestamp:
- Feb 6, 2012, 11:46:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/struct2nc.m
r246 r382 53 53 [Data,errormsg]=check_field_structure(Data);%check the validity of the input field structure 54 54 if ~isempty(errormsg) 55 errormsg=[' invalid input structure:' errormsg];55 errormsg=['error in struct2nc:invalid input structure_' errormsg]; 56 56 return 57 57 end … … 112 112 for ivar=1:length(ListVarName) 113 113 if isfield(Data,ListVarName{ivar}) 114 eval(['VarVal=Data.' ListVarName{ivar} ';'])%varval=values of the current variable 114 VarVal=Data.(ListVarName{ivar}); 115 %varval=values of the current variable 115 116 VarDimIndex=Data.VarDimIndex{ivar}; %indices of the variable dimensions in the list of dimensions 116 117 VarDimName=Data.VarDimName{ivar}; … … 122 123 testline=isequal(length(siz),2) && isequal(siz(1),1)&& isequal(siz(2), Data.DimValue(VarDimIndex));%matlab vector 123 124 testcolumn=isequal(length(siz),2) && isequal(siz(1), Data.DimValue(VarDimIndex))&& isequal(siz(2),1);%matlab column vector 124 if ~testrange && ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex))125 errormsg=['wrong dimensions declared for ' ListVarName{ivar} ' in struct2nc.m'];126 break127 end125 % if ~testrange && ~testline && ~testcolumn && ~isequal(siz,Data.DimValue(VarDimIndex)) 126 % errormsg=['wrong dimensions declared for ' ListVarName{ivar} ' in struct2nc.m']; 127 % break 128 % end 128 129 if testline || testrange 129 130 if testrange
Note: See TracChangeset
for help on using the changeset viewer.