Ignore:
Timestamp:
Feb 6, 2012, 11:46:39 PM (12 years ago)
Author:
sommeria
Message:

several bugs corrected
function filter_tps introduced (spline thin shell)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/check_field_structure.m

    r159 r382  
    5858        return
    5959    end
    60     eval(['sizvar=size(Data.' VarName ');'])% sizvar = dimension of variable
     60    sizvar=size(Data.(VarName));% sizvar = dimension of variable
    6161    DimCell=Data.VarDimName{ivar};
    6262    if ischar(DimCell)
     
    6565        errormsg=['wrong format for .VarDimName{' num2str(ivar) ' (must be the cell of dimension names of the variable ' VarName];
    6666        return
     67       
    6768    end
    6869    nbcoord=numel(sizvar);%nbre of coordinates for variable named VarName
     
    9192    else
    9293        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,
    9496        elseif nbcoord > numel(DimCell)
    9597            errormsg=['nbre of declared dimensions in .VarDimName{' num2str(ivar) '} smaller than the nbre of dimensions =' num2str(nbcoord) ' of the variable ' VarName];
     
    98100    end
    99101    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
    101104        DimName=DimCell{idim};
    102105        iprev=find(strcmp(DimName,Data.ListDimName),1);%look for dimension name DimName in the current list
     
    112115        else % DimName is detected in the current list of dimension names
    113116            if ~isequal(Data.DimValue(iprev),sizvar(idim))
     117                Data.DimValue(iprev)
     118                sizvar(idim)
    114119                if isequal(Data.DimValue(iprev),2)&& RangeTest(iprev)  % the dimension has been already detected as a range [min max]
    115120                    Data.DimValue(iprev)=sizvar(idim); %update with actual value
Note: See TracChangeset for help on using the changeset viewer.