Changeset 165


Ignore:
Timestamp:
Jan 3, 2011, 8:15:51 PM (10 years ago)
Author:
sommeria
Message:

sub_field: small bug corrected for field attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sub_field.m

    r127 r165  
    348348    DimCell=[DimCell Field_1.VarDimName([VarType_1.vector_x VarType_1.vector_y ])];
    349349    SubData.VarDimName=[SubData.VarDimName DimCell];
    350     if ~(isfield(SubData,'VarAttribute') && numel(SubData.VarAttribute)==numel(SubData.ListVarName))
    351         for ivar=numel(SubData.VarAttribute)+1:numel(SubData.ListVarName)-4
    352              SubData.VarAttribute{ivar}=[];
    353         end
    354     end
    355     SubData.VarAttribute=[SubData.VarAttribute {XAttr} {YAttr} {UAttr} {VAttr}];
     350    if isfield(SubData,'VarAttribute')
     351        if ~(numel(SubData.VarAttribute)==numel(SubData.ListVarName))
     352            for ivar=numel(SubData.VarAttribute)+1:numel(SubData.ListVarName)-4
     353                SubData.VarAttribute{ivar}=[];
     354            end
     355        end
     356        SubData.VarAttribute=[SubData.VarAttribute {XAttr} {YAttr} {UAttr} {VAttr}];
     357    end
    356358    eval(['SubData.' XName_1_1 '=Field_1.' XName_1 ';'])
    357359    eval(['SubData.' YName_1_1 '=Field_1.' YName_1 ';'])
Note: See TracChangeset for help on using the changeset viewer.