Changeset 876 for trunk/src/sub_field.m


Ignore:
Timestamp:
Feb 22, 2015, 11:07:07 PM (9 years ago)
Author:
sommeria
Message:

deformation modified in civ_series and bug corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sub_field.m

    r866 r876  
    4343    SubData=Field;
    4444    return
     45end
     46if ~isfield(Field_1,'VarAttribute')
     47    Field_1.VarAttribute={};
    4548end
    4649
     
    107110end
    108111
     112
    109113%% rename the dimensions of the second field if identical to those of the first
    110114for ilist=1:numel(Field_1.VarDimName)
     
    127131ind_remove=false(size(Field_1.ListVarName));
    128132% loop on the variables of the second field Field_1
    129 for ilist=1:numel(Field_1.ListVarName)
     133for ilist=1:numel(Field_1.VarAttribute)
    130134    % case of variable with a single dimension
    131135    if ~isempty(Field_1.VarAttribute{ilist}) && ~isempty(regexp(Field_1.VarAttribute{ilist}.Role,'^coord'))% if variable with Role coord... is found.
     
    173177ListVarNameNew=ListVarNameNew(~check_remove); % %list of renaimed varaibles corresponding to ListVarNameSub
    174178VarDimNameSub=Field_1.VarDimName(~check_remove);
     179if 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
     183end
    175184VarAttributeSub=Field_1.VarAttribute(~check_remove);
    176185check_rename=check_rename(~check_remove);
Note: See TracChangeset for help on using the changeset viewer.