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)
Ältere Kommentare anzeigen
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
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!