matrix.trace | R Documentation |
This function returns the trace of a given square numeric matrix.
matrix.trace(x)
x |
a matrix |
A numeric value which is the sum of the values on the diagonal.
If the argument x is not numeric, the function presents and error message and terminates. If the argument x is not a square matrix, the function presents an error message and terminates.
Frederick Novomestky fnovomes@poly.edu
Bellman, R. (1987). Matrix Analysis, Second edition, Classics in Applied Mathematics, Society for Industrial and Applied Mathematics.
A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE ) matrix.trace( A )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.