MATLAB: What is the error in this code

wesa

the code is :
clc
syms x
f(x)= input('f(x)=');
a = input('a=');
b = input('b=');
n=1;
x=a
x(1)=a;
x(n+1)=(x(n)-(f(x)/int(f(x))));
while x(n)~= x(n+1)
x=x(n);
n=n+1;
x(n+1)=(x(n)-(f(x))/int(f(x)));
end
display(x(n))
n=1;
x=b
x(1)=b;
x(n+1)=(x(n)-(f(x)/int(f(x))));
while x(n)~= x(n+1)
x=x(n);
n=n+1;
x(n+1)=(x(n)-(f(x))/int(f(x)));
end
display(x(n))
n=1;
x=(a+b)/2
x(1)=(a+b)/2;
x(n+1)=(x(n)-(f(x)/int(f(x))));
while x(n)~= x(n+1)
x=x(n);
n=n+1;
x(n+1)=(x(n)-(f(x))/int(f(x)));
end
display(x(n))
in command window :
f(x)=x^2-5*x+6
a=1
b=4
x =
1
The following error occurred converting from sym to double:
Error using mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a
double array.
If the input expression contains a symbolic variable, use the VPA function
instead.
Error in NewtonMethod (line 11)
x(n+1)=(x(n)-(f(x)/int(f(x))));
Related Question