polyplot


Untitled

Plots a MATLAB® polynomial

Syntax

polyplot(p)
polyplot(p,I)
polyplot( __,LineSpec)
polyplot( __ ,Name,Value)
h = polyplot( __ )

Description

polyplot(p) plots the polynomial represented by the row vector p (assuming standard MATLAB® polynomial form) over the interval .
polyplot(p,I) plots the polynomial p over the interval I = [a,b] where a and b are real scalar values.
polyplot( ___ ,LineSpec) sets the line style, marker symbol, and color.
polyplot( ___ ,Name,Value) specifies line properties using one or more Name,Value pair arguments. For a list of properties, see Chart Line Properties. Use this option with any of the input argument combinations in the previous syntaxes.
h = polyplot( ___ ) returns a column vector of chart line objects. Use h to modify properties of a specific polynomial plot after it is created.

Examples

Example 1 Plotting the Chebyshev polynomials:
A plot of the first five Chebyshev polynomials (of the first kind), , can be easily produced using the polyChebyshev and polyplot functions, i.e.,
hold on; box on;
for i = 0:4
polyplot(polyChebyshev(i),‘LineWidth’,2)
LegendText{i+1} = [‘T’,num2str(i),‘(x)’];
end
axis([-1 1 -1.1 1.1]);
legend(LegendText,‘Location’,‘northoutside’,
‘orientation’,‘horizontal’);
which can be compared to the plot shown here.
Note that the chart line properties of the polynomial plot (the line width in the example above) can be controlled just as they can be with the normal plot function, i.e., by specifying the appropriate Name, Value pairs.

This function is part of……..

PolyTools_Logo_v1.1.png