Changeset 1131
- Timestamp:
- 06/26/09 13:48:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/Exp/expcoarsen.m
r1093 r1131 37 37 38 38 %stop if we have reached end of profile (always keep the last point) 39 while j<numpoints -1,,39 while j<numpoints, 40 40 41 41 %See whether we keep this point or not 42 if sqrt((A(i).x(j)-A(i).x(j+1))^2+(A(i).y(j)-A(i).y(j+1))^2)<resolution 42 distance=sqrt((A(i).x(j)-A(i).x(j+1))^2+(A(i).y(j)-A(i).y(j+1))^2); 43 if distance<resolution & j<numpoints-1 %do not remove last point 43 44 A(i).x(j+1)=[]; 44 45 A(i).y(j+1)=[]; 45 46 numpoints=numpoints-1; 46 47 else 47 %update current point 48 j=j+1; 48 division=floor(distance/resolution)+2; 49 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)]; 54 55 %update current point 56 j=j+1+division-2; 57 numpoints=numpoints+division-2; 58 else 59 %update current point 60 j=j+1; 61 end 49 62 end 50 63 end
Note:
See TracChangeset
for help on using the changeset viewer.