EXPERIMENT - 3
AIM
To plot polynomial 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
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.