Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

TRACE Function

sums diagonal elements

TRACE( matrix)

where matrix is a numeric matrix or literal.

The TRACE function produces a single numeric value that is the sum of the diagonal elements of matrix. For example, the statement

   a=trace({5 2, 1 3});
produces the result
                A             1 row       1 col     (numeric)

                                          8

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.