1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| function fronts=convert_signal_en_fronts(vitesses,temps)
%fonction convertissant le signal vitesse_temps recu en fronts
%ascendant/descendant_50
test='convert_signa_en_fronts',
%temps1=temps;
[nl nc]=size(vitesses);
fronts=zeros(1,nc);
%recherche des fronts
for ind=1:nc
if ind<nc && vitesses(1,ind)==0 %front montant à 0
if vitesses(1,ind+1)~=0
fronts(1,ind)=1;
end
end
if ind<nc && ind>1
if vitesses(1,ind+1)>=50 && vitesses(1,ind-1)<50 %fronts descendants au niveau de 50
fronts(1,ind)=-1;
end
end
end
end |