Previous Page | Next Page

Language Reference

VECDIAG Function

VECDIAG( matrix ) ;

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

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

Figure 23.232 Diagonal of a Matrix
Test of NLPHQN subroutine: No Derivatives

d
2
-1

Previous Page | Next Page | Top of Page