Blog

• Home
• LabVIEW
• Matrix Operations With Arrays In Labview

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

Enhance your IT skills and proficiency by taking up the ?LabVIEW Training.

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

Check Out LabVIEW Tutorials    