clc %clean command window
clear all %clean mathlab memory

%***Inputs***
A = input ("Enter degree of polynomial:");%this input allows user to enter the degree for the polynominal

%****FOR LOOP TO REPEAT A SPECIFIED AMMOUNT OF TIMES****

for d = 1 : A+1
    Cof(d) = input (['Key in a coefficient multiplying x^', num2str(n-1),':']) ; %Cof is short for coefficiant, d abreviats number
end


% x=-100:0.01:100;%determine range of values for x within the set guidlines

x=-100:0.1:100;
B=0; %B=0 where the poly nominal 
for i = 0: a
    B = B + (Cof(i+1)*x.^i);
end

V = sign(P)
s2 = 1
s = 1
for i=1:length(V)-1
    if V (i)~=V(i+1) && (abs(V(i))==1 && abs(V(i+1))==1)
        LB (s) = i
        HB (s) = i+1
        s = s+1
    end
   
    if V(i)==0
        E(s2)=i
        s2 = s2+1
    end
end

R (s) = x(LB(1))+(x(HB(1))-x(LB(1)))/2
R (s) = sort (R(s))

%*********GRAPH PLOTER***********
plot(x,P,'color',[0 0 1],'line style','-','line width',2)%P(x)
xlabel('x-axis','font size',14,'font weight','itallic','color','b');
ylabel('y-axis','font size',14,'font weight','itallic','color','b');
title('polynominal','font size',14,'font weight','itallic','color','d')

hold on

y=0.*x;%generate vector y populated with 0's
plot(x,y,'-r')
hold on
y2=-30:50;
x2=0.*y2;%generate vector x2 of same size as y2 populated with 0's
plot(x2,y2,'-r')

grid on
grid minor





    
