Mindmajix

MATRIX OPERATIONS WITH ARRAYS IN LABVIEW

MATRIX OPERATIONS

We use the matrix data type to make modeling of math problems easier. Matrices group rows or columns of real or complex scalar data for some math operations, such as linear algebra operations. A two-dimensional array is similar to a matrix.

Converting an Array to a Matrix:

You can convert a one-dimensional or two-dimensional array of double-precision or complex numbers to a matrix and continue to use array functions to manipulate the matrix values.

Complete the following steps to convert an array to a matrix.

Step 1: Place a one-dimensional or two-dimensional array of floating-point values on the front panel.

Step 2: Place the Array To Matrix function on the block diagram.

Step 3: Wire the array to the Array To Matrix function.

Step 4: Right-click the Array To Matrix function and select Create»Indicator from the shortcut menu to create a matrix indicator.

Step 5: Run the VI. The matrix indicator displays the contents of the original array as shown in below Figure.

                                              13

If you wire a one-dimensional array to the Array to Matrix function, the function copies the array elements to the first column of the matrix. The function converts arrays that contain complex elements to complex matrices and converts all other arrays to real matrices. LabVIEW stores matrix elements with double-precision numerical values.

Converting a Matrix to an Array:

You can convert a matrix to a two-dimensional array and use array functions to manipulate the matrix values.

Complete the following steps to convert a matrix to a two-dimensional array.

Step 1: Place a Real Matrix or Complex Matrix control on the front panel.

Step 2: Place the Matrix To Array function on the block diagram.

Step 3: Wire a matrix to the Matrix To Array function.

Step 4: Right-click the Matrix To Array function and select Create»Indicator from the shortcut menu to create a two-dimensional array indicator.

Step 5: Run the VI from the front panel. The array indicator displays the contents of the array as shown in below Figure.

                                                  14

You can store a matrix of a single row or column in a one-dimensional array. However, LabVIEW cannot determine the dimensions of a matrix until runtime. The Matrix To Array function returns has the same element type, real or complex, as the matrix you wired to the Matrix To Array function.


0 Responses on MATRIX OPERATIONS WITH ARRAYS IN LABVIEW"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.