CALL TRANSPOSE Routine

Returns the transpose of a matrix.
Category: Matrix Operations

Syntax

CALL TRANSPOSE(X, Y);

Required Arguments

X
specifies an input matrix with dimensions m x n (that is, X[m, n]).
Y
specifies an output matrix with dimensions n x m (that is, Y[n, m])

Details

Note that the number of rows for the input matrix should be equal to the number of columns of the output matrix, and the number of rows for the output matrix should be equal to the number of columns of the input matrix.

Example

The following example uses the TRANSPOSE CALL routine:
options pageno=1 nodate;

proc fcmp;
   array mat1[3,2] (0.3, -0.78, -0.82, 0.54, 1.74, 1.2);
   array result[2,3];
   call transpose (mat1, result);
   put result=;
quit;
Output from the TRANSPOSE CALL Routine
                                The SAS System                               1

                              The FCMP Procedure

result[1, 1]=0.3 result[1, 2]=-0.82 result[1, 3]=1.74 result[2, 1]=-0.78
result[2, 2]=0.54 result[2, 3]=1.2