Create Special Matrix VI

Owning Palette: Linear Algebra VIs

Requires: Full Development System

Generates a special matrix based on matrix type. The data types you wire to the Input Vector2 and Input Vector1 inputs determine the polymorphic instance to use.

Example

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

Create Special Real Matrix

Input Vector2 used as the input to construct a special matrix in some options.
matrix type specifies the type of special matrix that this VI uses to generate as the Special Matrix output.

Let n represent matrix size, X represent Input Vector1, nx represent the size of X, and Y represent Input Vector2, ny represent the size of Y, and B represent the output Special Matrix.

0Identity—Generates an n-by-n identity matrix.
1Diagonal—Generates an nx-by-nx diagonal matrix whose diagonal elements are the elements of X.
2Toeplitz—Generates an nx-by-ny Toeplitz matrix, which has X as its first column and Y as its first row. If the first element of X and Y are different, the first element of X is used.
3Vandermonde—Generates an nx-by-nx Vandermonde matrix whose columns are powers of the elements of X. The elements of a Vandermonde matrix are:

bi,j = xinxj – 1

where i,j = 0…nx – 1.
4Companion—Generates an nx-1-by-nx-1 companion matrix. If vector X is a vector of a polynomial coefficient, the first element of X is the coefficient of the highest order, the last element of X is the constant term in the polynomial, the corresponding companion matrix is constructed as follows: the first row is

the rest of B from the second row is an identity matrix.
The eigenvalues of a companion matrix contain the roots of the corresponding polynomial.
5Hankel—Generates an nx-by-ny Hankel matrix, where X is the first column and Y is the last row of the matrix. If the first element of Y and last element of X are different, this VI uses the last element of X.
6Hadamard—Generates an n-by-n Hadamard matrix, whose elements are 1 and –1. All columns or rows are orthogonal to each other. matrix size must be a power of 2, a power of 2 multiplied by 12, or a power of 2 multiplied by 20. If n is 1, this VI returns an empty matrix.
7Wilkinson—Generates an n-by-n Wilkinson matrix whose eigenvalues are ill-conditioned.
8Hilbert—Generates an n-by-n Hilbert matrix, which has elements according to the following equation.

where i,j = 0,1,…n – 1
9Inverse Hilbert—Generates the inverse of an n-by-n Hilbert matrix.
10Rosser—Generates an 8-by-8 Rosser matrix whose eigenvalues are ill-conditioned.
11Pascal—Generates an n-by-n symmetric Pascal matrix, which has elements according to the following equation.

where i,j = 0,1,…n – 1
matrix size determines the dimension size of the output Special Matrix.
Input Vector1 used as the input to construct a special matrix in some options.
Special Matrix is the generated matrix.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Create Special Complex Matrix

Input Vector2 used as the input to construct a special matrix in some options.
matrix type specifies the type of special matrix that this VI uses to generate as the Special Matrix output.

Let n represent matrix size, X represent Input Vector1, nx represent the size of X, and Y represent Input Vector2, ny represent the size of Y, and B represent the output Special Matrix.

0Identity—Generates an n-by-n identity matrix.
1Diagonal—Generates an nx-by-nx diagonal matrix whose diagonal elements are the elements of X.
2Toeplitz—Generates an nx-by-ny Toeplitz matrix, which has X as its first column and Y as its first row. If the first element of X and Y are different, the first element of X is used.
3Vandermonde—Generates an nx-by-nx Vandermonde matrix whose columns are powers of the elements of X. The elements of a Vandermonde matrix are:

bi,j = xinxj – 1

where i,j = 0…nx – 1.
4Companion—Generates an nx-1-by-nx-1 companion matrix. If vector X is a vector of a polynomial coefficient, the first element of X is the coefficient of the highest order, the last element of X is the constant term in the polynomial, the corresponding companion matrix is constructed as follows: the first row is

the rest of B from the second row is an identity matrix.
The eigenvalues of a companion matrix contain the roots of the corresponding polynomial.
5Hankel—Generates an nx-by-ny Hankel matrix, where X is the first column and Y is the last row of the matrix. If the first element of Y and last element of X are different, this VI uses the last element of X.
6Hadamard—Generates an n-by-n Hadamard matrix, whose elements are 1 and –1. All columns or rows are orthogonal to each other. matrix size must be a power of 2, a power of 2 multiplied by 12, or a power of 2 multiplied by 20. If n is 1, this VI returns an empty matrix.
7Wilkinson—Generates an n-by-n Wilkinson matrix whose eigenvalues are ill-conditioned.
8Hilbert—Generates an n-by-n Hilbert matrix, which has elements according to the following equation.

where i,j = 0,1,…n – 1
9Inverse Hilbert—Generates the inverse of an n-by-n Hilbert matrix.
10Rosser—Generates an 8-by-8 Rosser matrix whose eigenvalues are ill-conditioned.
11Pascal—Generates an n-by-n symmetric Pascal matrix, which has elements according to the following equation.

where i,j = 0,1,…n – 1
matrix size determines the dimension size of the output Special Matrix.
Input Vector1 used as the input to construct a special matrix in some options.
Special Matrix is the generated matrix.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Example

Refer to the Matrix to a Power VI in the labview\examples\Mathematics\Linear Algebra directory for an example of using the Create Special Matrix VI.

 Open example  Find related examples