PDA

View Full Version : how to remve repated bins from hydrographic profile



toti
9th August 2010, 06:13 PM
Hi everyone
Does anyone can help to remove repeated bins from hydrographic profiles I've used diff to remove it
but still there is repeated bins
I used these routines after defining D0=met1(:,1);T0=met1(:,2); S0=met1(:,3);
% Remove repeated bins for each station
I = 1;
F0 = diff(D0);
X0 = find(F0==0);
if isempty(X0) ~= 1
D00=[]; T00=[]; S00=[];
for i = 1 : length(X0)
d0 = D0(I:X0(i)-1);
d00 = ((D0(X0(i))) + (D0(X0(i)+1)))/2;
D00 = [D00;d0;d00];
t0 = T0(I:X0(i)-1);
t00 = ((T0(X0(i))) + (T0(X0(i)+1)))/2;
T00 = [T00;t0;t00];
s0 = S0(I:X0(i)-1);
s00 = ((S0(X0(i))) + (S0(X0(i)+1)))/2;
S00 = [S00;s0;s00];
I = X0(i)+2;
end
D00 = [D00;D0(I:length(D0))];
T00 = [T00;T0(I:length(D0))];
S00 = [S00;S0(I:length(D0))];

else
D00 = [D0];
T00 = [T0];
S00 = [S0];
end

42d3e78f26a4b20d412==