clc
clearvars
close all
d= input('Input a value of the degree: ');
for n=1:d+1
    coef(n)=input (['enter coefficient that multiplies x^',num2str(n-1),': ']);
end
x=-100:0.1:100;
y=0;
for i=0:d
    y=y+coef(i+1)*x.^i;
end
y;
plot(x,y,'b')
title('Graph of Polynomial','Color','b','FontSize',16,'FontWeight','bold')
xlabel('x-axis','Color','r','FontSize',12,'FontWeight','bold')
ylabel('y-axis','Color','r','FontSize',12,'FontWeight','bold')
grid
grid minor

VS=sign(y)
k=1
for i=1:2000
    if VS(i)~=VS(i+1) & VS(i)~=0 & VS(i+1)~=0
        RootLocation(k)=i
        k=k+1
        if VS(i)==0
        end
    end
end 

