Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What does this message mean in matlab ?

1 回表示 (過去 30 日間)
mar vouz
mar vouz 2016 年 4 月 26 日
コメント済み: John D'Errico 2016 年 4 月 26 日
So I created the following code :
% code
x=0;
h=0.001;
tol_root=1e-05;
tol_x=1e-05;
for i = 1:1:50
f=@(x) x.^2 + 0.16*x -0.237;
fpl=@(x) f(x+h);
fout=@(x) f(x-h);
df=@(x) (fpl(x)-fout(x))/(2*h);
if df(x)==0 then
if f(x)<=tol_root
i=51;
else
x=x+h
end
end
xnew=x-f(x)/df(x);
if abs (xnew-x)<= tol_x
e(i)=@(x) abs(xnew-x)
i=51
else
x=xnew
end
end
xroot=xnew
And it actually gives me seven roots.But also it gives me this message:
* _The following error occurred converting from function_handle to double:
Error using double
Conversion to double from function_handle is not possible.*
why?
  1 件のコメント
John D'Errico
John D'Errico 2016 年 4 月 26 日
Please don't ask the same question multiple times.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by