MATLAB: How to get z for different x

algebra

x = [-2:0.1:2];
z=x.*(1-x).*(2-x).*(4-x)/((6-x)-(1-x).*(x-7));
I am getting error. Please correct my problem.

Best Answer

x = [-2:0.1:2];
z = x.*(1-x).*(2-x)./((6-x).*(x-7));
You just forgot a ./
Now you should have a vector
x = [-2:0.1:2];
z = x.*(1-x).*(2-x)./((6-x).*(x-7));
plot(x,z)