ZeroCrossing on a graph

I have to create a zerocrossing script which says when a graph passes from positive values to negative values (only this case) and then it plots a graph including all these points of zero crossing. Can someone help me with a code?

4 comentarios

Guillaume
Guillaume el 18 de Sept. de 2017
So... what is your question?
Nicholas Saladini
Nicholas Saladini el 18 de Sept. de 2017
I'm trying to create a code but i can't do it.
dpb
dpb el 18 de Sept. de 2017
Consider what happens to diff(y) and look at
doc sign
for ideas...
Nicholas Saladini
Nicholas Saladini el 18 de Sept. de 2017
if true
% code
plot(sig_AP, 'y')
hold on
for i = 1:length(sig_AP)-1
if ( sig_AP(i)>0 && sig_AP(i+1)<0 )
sig_AP(i+1) = 0-sig_AP(i+1);
x = sig_AP(i);
y = sig_AP(i+1);
if ( x > y )
ZC(i) = sig_AP(i+1);
else
ZC(i) = sig_AP(i);
end
else
ZC(i) = 0;
end
end
ZC = ZC'
plot (ZC, 'k')
end
I try something like this but it doesn't work... i'm not very able with matlab..

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Sept. de 2017

Comentada:

el 18 de Sept. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by