'Problem' with fzero
Show older comments
Hi, hope you all are well. I am here due to a problem with the function called 'fzero'.
On one hand, I have this file: f.m
function y=f(x)
y= besselj(1,x);
And on the other hand: exercise.m
D=fzero(@f,[0 10]);
tam=length(D);
for i=1:tam
fprintf(' Possible MAX or MIN: f(%f) \n',D(i))
end
When I run exercise.m, I get this output:
Possible MAX or MIN: f(0.000000)
I know where this values should be located...

What am I doing wrong? Thanks in advance. PD: I have to use fzero and besselj(1,x) at [0:10]
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!