obviously, I an not a programmer. I saw this code for newton raphson method (for schoolwork), but when i tried to run it, it said that Ishould use an anonymous functions instead. what should i do?
clear , clccf=input('ingrese funcion a evaluar: ');syms xf=inline(cf);derivada=diff(cf,x);df=inline(derivada);tol = input('ingrese tolerancia: ');error = 50;x=input('ingrese un valor inicial: ');n =0;disp(' n xi error')while (error>tol)fprintf('\t%i\t%3.5f\t%f\n', n, x, error);n=n+1;x=x-f(x)/df(x);error= abs(f(x));end
Best Answer