CALL Statement (MATRIX-END MATRIX command)

Closely related to the matrix functions are the matrix procedures, which are invoked with the CALL statement. Procedures, similarly to functions, accept arguments enclosed in parentheses and separated by commas. They return their result in one or more of the arguments as noted in the individual descriptions below. They are implemented as procedures rather than as functions so that they can return more than one value or (in the case of SETDIAG) modify a matrix without making a copy of it.

EIGEN(M,var1,var2). Eigenvectors and eigenvalues of a symmetric matrix. Takes three arguments: a symmetric matrix and two valid variable names to which the results are assigned. If M is a symmetric matrix, the statement CALL EIGEN(M, A, B) will assign to A a matrix having the same dimensions as M, containing the eigenvectors of M as its columns, and will assign to B a column vector having as many rows as M, containing the eigenvalues of M in descending numerical order. The eigenvectors in A are ordered to correspond with the eigenvalues in B; thus, the first column corresponds to the largest eigenvalue, the second to the second largest, and so on.

SETDIAG(M,V). Set the main diagonal of a matrix. Takes two arguments, a matrix and a vector. Elements on the main diagonal of M are set equal to the corresponding elements of V. If V is a scalar, all the diagonal elements are set equal to that scalar. Otherwise, if V has fewer elements than the main diagonal of M, remaining elements on the main diagonal are unchanged. If V has more elements than are needed, the extra elements are not used. See also the MDIAG matrix function.

SVD(M,var1,var2,var3). Singular value decomposition of a matrix. Takes four arguments: a matrix and three valid variable names to which the results are assigned. If M is a matrix, the statement CALL SVD(M,U,Q,V) will assign to Q a diagonal matrix of the same dimensions as M, and to U and V unitary matrices (matrices whose inverses equal their transposes) of appropriate dimensions, such that M=U*Q* T(V), where T is the transpose function defined above. The singular values of M are in the main diagonal of Q.