clc
clear all
deg=input('Input the degree of pylonomial:');
for P=1:deg+1
    coef(P)=input(['Input the coefficient value of x^', num2str(P-1) ' : ']);
end
%The firs forloop will ask you to enter the first forloop counter of the
%polynomial P-1
X=[-100:0.1:100];
L=0;

for P=0:deg 
    L=L+coef(P+1).*X.^P;
end
plot(X,L);
s=sign(L);
ylim([-30,50])
xlim([-6,8])
xticks(-6:1:8)
yticks(-30:5:50)
%The ticks present the increase of the number of the graph
title('Graph of polynomial','colour','b','Font size',16,'Font weight','bold');
xlabel('X-Axis','colour','r','Font size',12,'Font weight','bold');
ylabel('X-Axis','colour','r','Font size',12,'Font weight','bold');
%This will allow the user to input titles for the axis
%This will allow the user to select a colour for the axis
%This will allow the user to select a font size for the axis

y=0.*X;
hold on
plot(X,y,'-r');
y2=-30:50;
x2=0.*y2;
hold on
plot(x2,y2,'-r');
grid minor
%this allows the graph to be plotted

    