% Clearing the workspace %
clc
clear
% Inputting the degree of the polynomial %
n = input('What is the degree of your polynomial?   ');
% Inputting the coefficients of the polynomial %
p1 = input('What is the first coefficient?   ');
p2 = input('What is the second coeffciient?  ');
p3 = input('What is the third coefficient?   ');
p4 = input('What is the fourth coefficient?  ');
p5 = input('What is the fifth coefficient?   ');
% Determining X values between -100 and 100 %
X = (-100:100);
x1 = (p1*X).^n;
x2 = (p2*X).^n-1;
x3 = (p3*X).^n-2;
x4 = (p4*X).^n-3;
x5 = (p5*X).^n-4;
% vector P %
P = [x1 x2 x4 x5];
% Plotting the polynomial %
plot(X,polyval(P,X))

% Setting the title and labelling the axis %
title("Graph of Polynomial")
t = xlabel("x-axis");
q = ylabel("y-axis");
% Setting the x-axis to be red, have a font size 12, and to be bold)
t.Color = 'red';
t.FontSize = '12';
t.FontWeight = 'bold';
% Setting the y-axis to be red, have a font size 12, and to be bold %
q.Color = 'red';
q.FontSize = '12';
q.FontWeight = "bold";
% Setting the x limits to be between first and two final roots %
xlim([1 2])
% Setting the y limits to be between the extrema 2 %
ylim([0 2])