# Polynomial Evaluation (With Matrix) (G Dataflow)

Version:
Last Modified: March 15, 2017

Evaluates a polynomial with a matrix.

## A

Square matrix of values.

A acts as the independent variable of polynomial. If A is not square, the node sets polynomial evaluation to an empty array and returns an error.

This input accepts the following data types:

• 2D array of double-precision, floating-point numbers
• 2D array of complex double-precision, floating-point numbers

## polynomial

Polynomial coefficients in ascending order of power.

This input accepts the following data types:

• 1D array of double-precision, floating-point numbers
• 1D array of complex double-precision, floating-point numbers

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## polynomial evaluation

Evaluation of the polynomial at the values in A.

This output can return the following data types:

• 2D array of double-precision, floating-point numbers
• 2D array of complex double-precision, floating-point numbers

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Evaluating a Polynomial with Matrix

This node evaluates the polynomial P(x) with the square matrix A. For example, the following polynomial defines the second-order polynomial described by the three-element array P[0...2]:

$P\left[2\right]{x}^{2}+P\left[1\right]x+P\left[0\right]$

The evaluation of the preceding polynomial by the node yields the following result:

$P\left(\left[A\right]\right)=P\left[2\right]{A}^{2}+P\left[1\right]A+P\left[0\right]I$

where I is the identity matrix and the same size as A.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices