1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
clear,clc
load data.mat
load f.mat
n=5;
sortir=0;
for i=1:50
if x(i)~=0
disp(x(i))
if x(i)==n
X(i,1)=x(i,1)
else
X(i,1)=y(i+1,1);
n1=x(i);
sortir=1;
indf=i+1;
end
end
if sortir==1, break,end
end
while y(indf)-n1 == 0
X(indf,1)=y(indf,1);
if indf==50,break, end
indf=indf+1;
n2=y(indf);
end
indf=indf+1;
X(indf,1)=y(indf,1);
while z(indf,1)-n2==0
X(indf,1)=z(indf,1);%
if indf==50,break, end
indf=indf+1;
n3=z(indf);
end
indf=indf;
while z(indf,1)-n3==0
X(indf,1)=f(indf,1);%
if indf==50,break, end
indf=indf+1;
n3=z(indf);
end
%
clf,plot(x,'.r'),hold on
plot(y,'.g'),hold on
plot(z,'.k'),hold on
plot(f,'.b'),hold on
plot(X,'^k') |
Partager