Answers for "How to extract values from a SAS matrix"

2

How to extract values from a SAS matrix

proc iml;
A = shape(1:30, 5);     /* 5 x 6 matrix */
scalar = A[2,1];
row = A[2, ];           /* 2nd row */
cols = A[ , {3 1}];     /* 3rd and 1st columns */
matrix =  A[3:4, 1:2];  /* 2 x 2 matrix: (A[3,1] || A[3,2]) // 
                                         (A[4,1] || A[4,2]) */
print A, scalar, row, cols, matrix;
Posted by: Guest on June-12-2021

Code answers related to "How to extract values from a SAS matrix"

Browse Popular Code Answers by Language