How do I find the zero crossings for a function sinx/x against x?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have used the following code to plot
x=linspace(-90,90,10000);
y=sin(x)./x;
plot(x,y);
axis([-90 90 -1.5 1.5])
xlabel('x')
ylabel('y')
title('A GRAPH OF A FUNCTION Y=(SINX)/X AGAINST X')
0 Kommentare
Antworten (2)
ANKUR KUMAR
am 11 Jul. 2021
Do you mean to find the x values which cooresponds to the zero in the y values?
I do not think you have zero value in y variables (It is close to zero, but not exactly zero).
This is an example using the round function so that it yields nearest integer value.
x=linspace(-90,90,10000);
y=round(sin(x)./x);
x_vals=x(y==0)
x_vals contains the x values which corresponds to zero in y values.
0 Kommentare
Matt J
am 11 Jul. 2021
Bearbeitet: Matt J
am 11 Jul. 2021
You can see analytically that the zeros will occur when the numerator sin(x) has a zero crossing, which will occur at non-zero integer multiples of pi. At x=0, L'hopital's rule readily shows you that there is no zero crossing there.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!