EXPERIMENT - 3


AIM

To plot polynomial 4x426x3+30x2+20x4x^4-26x^3+30x^2+ 20x in MATLAB.

THEORY

A polynomial is a mathematical expression involving a sum of powers in one or more variables multiplied by coefficients. A polynomial in one variable (i.e., a univariate polynomial) with constant coefficients is given by a0+a1x1+a2x2+a3x3+a4x4+a5x5+a6x6.......anxna_0+a_1 x^1+a_2 x^2+a_3 x^3+a_4 x^4+a_5x^5+a_6x^6.......a_n x^n

where n is the order of ploynomial.

MATLAB COMMANDS USED

* plot(x,y,color,properties)

MATLAB CODE

clear all;
x=-1:0.01:5;
y=4*x.^4-26*x.^3+30*x.^2+20*x;
plot(x,y,'black','linesmoothing','on');
title('Plot of 4x^{4} - 26x^{3} + 30x^{2} + 20x');
xlabel('X    ----------->'); grid on;
print('polynomial','-dpng')

RESULT

The specified ploynomial has been plotted.