Polynomials, MATLAB in Statistics

Polynomials:

Simple curves are polynomials of various degrees, or orders. The degree is the integer of the highest exponent in the expression. The illustrations are as follows:

  • A straight line is the first order or degree 1 polynomial of the form ax + b, or more clearly ax1+ b.
  • A quadratic is a second order (or degree 2) polynomial of the form ax2 + bx + c.
  • A cubic (degree 3) is of the form ax3 + bx2 + cx + d.

A MATLAB represents a polynomial as a row vector of coefficients. For illustration, the polynomial x3 + 2x2 - 4x + 3 would be represented by the vector [1 2 -4 3].

The polynomial 2x4 - x2 + 5 would be represented by [2 0 -1 0 5]; note that the zero terms for x3 and x1.

There are built-in functions sym2poly and poly2sym which convert symbolic expressions to polynomial vectors and vice versa, the illustration is as shown below:

>> myp = [1,2,-4,3];

>> poly2sym(myp)

ans =

x^3+2*x^2-4*x+3

>> mypoly = [2 0 -1 0 5];

>> poly2sym(mypoly)

ans =

2*x^4-x^2+5

>> sym2poly(ans)

ans =

2 0 -1 0 5

Posted Date: 10/22/2012 8:40:45 AM | Location : United States







Related Discussions:- Polynomials, Assignment Help, Ask Question on Polynomials, Get Answer, Expert's Help, Polynomials Discussions

Write discussion on Polynomials
Your posts are moderated
Related Questions
Illustration of Indexing: Though, rather than of creating the index vector manually as shown here, the process to initialize the index vector is use to a sort function. The al

Graphics objects: The objects involve graphics primitives like lines and text, and also the axes used to orient the objects. These objects are organized hierarchically, and the

Editor/Debugger: The MATLAB has numerous useful functions for debugging, and debugging can also be completed through its editor, which is known as the Editor/Debugger. Typi

Vectors of nested structures: The Combining vectors and nested structures are possible to have a vector of structures in which several fields are structures themselves. Here i

Input in a While Loop: The script below repeats the procedure of prompting a user, the reading in a positive number, and echo-printing it, as long as the user properly enters

Example of Functions which return values: Calling this function prints the circumference, since there is no way to store the value, hence, it can be used in following computat

Function polyval - interpolation: The function polyval can then be used to compute the polynomial at particular values. For illustration, we could compute at every value in th

Example of Nested functions: For illustration, the function below computes and returns the volume of a cube. Three arguments are then passed to it, for the width and length of

Example of Median For the vector [1 4 5 9 12 33], the median is the average of the 5 & 9 in the middle: >> median([1 4 5 9 12 33]) ans =     7

Functions which return Values versus printing: Also, the function which computes and returns values (throughout the output arguments) does not generally print them; that is le