'Problem' with fzero
古いコメントを表示
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]
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!