I did it like this...
function []=test
syms x
digits(9);
func= input('Please enter f(x) = ');
Xest= input('Pleae enter an initial guess = ');
d=diff(func,x);
x=Xest;
for i = 0:15
ds=eval(d);
fs=eval(func);
x = x-((fs)./(ds));
vpa(x)
if x(i-1)==x(i)
break
end
end
end
Didn't end up using anonymous function.
The if loop is a little messed up beacuse I'm trying to find a way to break it once the answer repeats but I basically just changed x from symbolic and assigned the value of the guess to it then evaluated the function using "eval()"
I'm sure there's a better way to do it.