Changeset 876 for trunk/src/sub_field.m
- Timestamp:
- Feb 22, 2015, 11:07:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sub_field.m
r866 r876 43 43 SubData=Field; 44 44 return 45 end 46 if ~isfield(Field_1,'VarAttribute') 47 Field_1.VarAttribute={}; 45 48 end 46 49 … … 107 110 end 108 111 112 109 113 %% rename the dimensions of the second field if identical to those of the first 110 114 for ilist=1:numel(Field_1.VarDimName) … … 127 131 ind_remove=false(size(Field_1.ListVarName)); 128 132 % loop on the variables of the second field Field_1 129 for ilist=1:numel(Field_1. ListVarName)133 for ilist=1:numel(Field_1.VarAttribute) 130 134 % case of variable with a single dimension 131 135 if ~isempty(Field_1.VarAttribute{ilist}) && ~isempty(regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))% if variable with Role coord... is found. … … 173 177 ListVarNameNew=ListVarNameNew(~check_remove); % %list of renaimed varaibles corresponding to ListVarNameSub 174 178 VarDimNameSub=Field_1.VarDimName(~check_remove); 179 if numel(Field_1.VarAttribute)<max(find(~check_remove)) 180 for ilist=numel(Field_1.VarAttribute)+1:max(find(~check_remove)) 181 Field_1.VarAttribute{ilist}={}; 182 end 183 end 175 184 VarAttributeSub=Field_1.VarAttribute(~check_remove); 176 185 check_rename=check_rename(~check_remove);
Note: See TracChangeset
for help on using the changeset viewer.