How do I find the zero crossings for a function sinx/x against x?
14 views (last 30 days)
Show older comments
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 Comments
Answers (2)
ANKUR KUMAR
on 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 Comments
See Also
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!