Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

What does this message mean in matlab ?

1 Ansicht (letzte 30 Tage)
mar vouz
mar vouz am 26 Apr. 2016
Kommentiert: John D'Errico am 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 Kommentar
John D'Errico
John D'Errico am 26 Apr. 2016
Please don't ask the same question multiple times.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by