Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

What does this message mean in matlab ?

1 visualización (últimos 30 días)
mar vouz
mar vouz el 26 de Abr. de 2016
Comentada: John D'Errico el 26 de Abr. de 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 comentario
John D'Errico
John D'Errico el 26 de Abr. de 2016
Please don't ask the same question multiple times.

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by