Language Reference

VECDIAG Function

creates a vector from a diagonal

VECDIAG( square-matrix)

where square-matrix is a square numeric matrix.

The VECDIAG function creates a column vector whose elements are the main diagonal elements of square-matrix. For example, the following statements produce the column vector shown:

  
    a={2 1, 0 -1}; 
    c=vecdiag(a);
 

  
                 C             2 rows      1 col     (numeric) 
  
                                           2 
                                          -1
 

Previous Page | Next Page | Top of Page