Converting a Matrix to an Array
- Updated2025-04-01
- 1 minute(s) read
You can convert a matrix to a 2D array and use Array functions to manipulate the matrix values. Complete the following steps to convert a matrix to a 2D array.
- Add a real matrix or complex matrix control to the front panel.
Real matrix
Complex matrix
- Add the Matrix To Array function to the block diagram.
- Wire a matrix to the Matrix To Array function.
- Right-click the Matrix To Array function and select Create»Indicator from the shortcut menu to create a 2D array indicator.
- Run the VI from the front panel. The array indicator displays the contents of the array.
You can store a matrix of a single row or column in a 1D array. However, LabVIEW cannot determine the dimensions of a matrix until run time.The 2D array 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. You also can convert an array to a matrix.