huj033 发表于 2011-6-11 19:54 
我要用sas 将一个32*21的矩阵或者数据集,提取其每一列得到21个32*1的向量,不知矩阵循环的命名该怎吗弄?下面是我写的不知问题出在哪里
proc iml;
use work.t;
read all into mx;
do i=1 to 21;
m&i=mx[,i];
print m1;quit;
不知是不是循环角标的问题 m(i) 、 m好像都不行!
或者 用宏!
All the information is already in mx, you will end up using additional resource for nothing.
You can easily refer the column or row vector as in the following example,
proc iml;
a={1 0 1 3,1 3 1 4,2 1 2 2 ,2 1 8 9 ,3 1 0 0};
alast=a[ ,ncol(a)];
afirst=a[ ,1];
print a afirst alast;
quit;