Home / Labview

# Matrix Operations With Arrays In Labview

Rating: 4.0 Views: 6994
by Ruchitha Geebu

## 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.

If you would like to Enrich your career with an Android certified professional, then visit Mindmajix - A Global online training platform: “LabVIEW training” Course.This course will help you to achieve excellence in this domain.

## 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 the below Figure. 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.  