Changeset 1219


Ignore:
Timestamp:
07/02/09 15:48:19 (16 years ago)
Author:
Eric.Larour
Message:

some mods

Location:
issm/trunk/src/m/utils/Exp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Exp/expcoarsen.m

    r1131 r1219  
    3030
    3131%Go through the profiles
    32 for i=1:numprofiles
     32count=1;
     33while count<=numprofiles,
    3334
    3435        %get number of points and initialize j
    35         numpoints=length(A(i).x);
     36        numpoints=length(A(count).x);
    3637        j=1;
    3738
     
    4041
    4142                %See whether we keep this point or not
    42                 distance=sqrt((A(i).x(j)-A(i).x(j+1))^2+(A(i).y(j)-A(i).y(j+1))^2);
     43                distance=sqrt((A(count).x(j)-A(count).x(j+1))^2+(A(count).y(j)-A(count).y(j+1))^2);
    4344                if distance<resolution & j<numpoints-1  %do not remove last point
    44                         A(i).x(j+1)=[];
    45                         A(i).y(j+1)=[];
     45                        A(count).x(j+1)=[];
     46                        A(count).y(j+1)=[];
    4647                        numpoints=numpoints-1;
    4748                else
    4849                        division=floor(distance/resolution)+2;
    4950                        if division>2,
    50                                 x=linspace(A(i).x(j),A(i).x(j+1),division)';
    51                                 y=linspace(A(i).y(j),A(i).y(j+1),division)';
    52                                 A(i).x=[A(i).x(1:j);x(2:end-1); A(i).x(j+1:end)];
    53                                 A(i).y=[A(i).y(1:j);y(2:end-1); A(i).y(j+1:end)];
     51                                x=linspace(A(count).x(j),A(count).x(j+1),division)';
     52                                y=linspace(A(count).y(j),A(count).y(j+1),division)';
     53                                A(count).x=[A(count).x(1:j);x(2:end-1); A(count).x(j+1:end)];
     54                                A(count).y=[A(count).y(1:j);y(2:end-1); A(count).y(j+1:end)];
    5455
    5556                                %update current point
     
    6263                end
    6364        end
    64 
     65        if length(A(count).x)<=1,
     66                A(count)=[];
     67                numprofiles=numprofiles-1;
     68        else
     69                count=count+1;
     70        end
    6571end
    6672
  • issm/trunk/src/m/utils/Exp/expopen.m

    r1135 r1219  
    88
    99a=expread(oldname,0); %0 for opening.
    10 expwrite(newname,a);
     10expwrite(a,newname);
Note: See TracChangeset for help on using the changeset viewer.