Changeset 1219
- Timestamp:
- 07/02/09 15:48:19 (16 years ago)
- Location:
- issm/trunk/src/m/utils/Exp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/Exp/expcoarsen.m
r1131 r1219 30 30 31 31 %Go through the profiles 32 for i=1:numprofiles 32 count=1; 33 while count<=numprofiles, 33 34 34 35 %get number of points and initialize j 35 numpoints=length(A( i).x);36 numpoints=length(A(count).x); 36 37 j=1; 37 38 … … 40 41 41 42 %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); 43 44 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)=[]; 46 47 numpoints=numpoints-1; 47 48 else 48 49 division=floor(distance/resolution)+2; 49 50 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)]; 54 55 55 56 %update current point … … 62 63 end 63 64 end 64 65 if length(A(count).x)<=1, 66 A(count)=[]; 67 numprofiles=numprofiles-1; 68 else 69 count=count+1; 70 end 65 71 end 66 72 -
issm/trunk/src/m/utils/Exp/expopen.m
r1135 r1219 8 8 9 9 a=expread(oldname,0); %0 for opening. 10 expwrite( newname,a);10 expwrite(a,newname);
Note:
See TracChangeset
for help on using the changeset viewer.