Answers for "define a function on SAS IML"

0

define a function on SAS IML

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} */
Posted by: Guest on June-19-2021

Browse Popular Code Answers by Language