How do I find the zero crossings for a function sinx/x against x?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
ANKUR KUMAR
le 11 Juil 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 commentaires
Matt J
le 11 Juil 2021
Modifié(e) : Matt J
le 11 Juil 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 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!