Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

What does this message mean in matlab ?

1 visualizzazione (ultimi 30 giorni)
mar vouz
mar vouz il 26 Apr 2016
Commentato: John D'Errico il 26 Apr 2016
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 Commento
John D'Errico
John D'Errico il 26 Apr 2016
Please don't ask the same question multiple times.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by