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.


icon

Inputs/Outputs

  • c2ddbl.png 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.

  • idbl.png trace

    trace is the sum of the main diagonal of Input Matrix.

  • ii32.png 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