clc
clear vars
close all
deg=input('Enter the degree of your polynomial:');

for i=1:deg+1
    coef(i)=input(['Enter the coefficient value of x^',num2str(i-1) ' : ']);
end
%This first for loop will ask me to enter there first for loop counter of the polynomial i-1

X=[-100:0.1:100];
P=0;
for i=0:deg
    P=P+coef(i+1).*X.^i;
end
plot(X,P);
s=sign(P);
ylim([-30,50])
xlim([-6,8])
xticks(-6:1:8)
yticks(-30:5:50)
%The ticks show of how much the number of graph will go up in
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');
%The code will allow the user to input titel of the title of my graph axis
%The colour allows me to see what colour the x and y axis will be 
%the font size will allow me to see what font I want my axis to be   

y=0.*X;
hold on 
plot(X,y,'-r');
y2=-30:50;
x2=0.*y2;
hold on 
plot(x2,y2,'-r');
grid minor
%This code allows me to plot the graph 