Complex Matrix Trace VI
- Updated2025-07-30
- 2 minute(s) read
Finds the trace of Input Matrix. Wire data to the Input Matrix input to determine the polymorphic instance to use or manually select the instance.

Inputs/Outputs
Input Matrix
—
Input Matrix is a square or rectangular matrix. If Input Matrix is an empty matrix, this VI sets trace to NaN and returns an error.
trace
—
trace is the sum of the main diagonal of Input Matrix.
error
—
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. |
The VI uses the following equation to compute the trace.
where A is Input Matrix, tr(A) is trace, and m and n are the number of rows and the number of columns of Input Matrix, respectively.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Mathematics\Linear Algebra\Linear Algebra Calculator.vi
Input Matrix
—
trace
—
error
—