全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1529 2
2012-11-05
You may code it as a function call.

proc iml;

a=shape(1:25,5,5);
n=nrow(a);
***remove R3C3****;
%let k=3;
idx1=cusum( &k || j(1,n-1,5) );
idx2=((&k-1)*n+1):&k*n;


b=shape(remove(a,idx1||idx2),n-1,n-1);
print  idx1 idx2 ;
print  a ;
print  b ;
quit;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-11-5 10:19:48
?///??
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-11-5 11:14:38
谢谢分享
function与连接符||之间很巧妙的应用.



idx1 || idx2正好与remove function 中的indices对应

REMOVE( matrix, indices)
The inputs to the REMOVE function are as follows:
matrix
is a numeric or character matrix or literal.
indices
refers to a matrix containing the indices of elements that are removed from matrix.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群