📅  最后修改于: 2022-03-11 14:58:31.535000             🧑  作者: Mango
proc iml;
/* square each element of a matrix */
start Sqr(x);
return( x#x ); /* elementwis multiplication */
finish;
x = 1:5; /* x = {1 2 3 4 5} */
y = Sqr(x); /* square each element: y = {1 4 9 16 25} */