Statistical programming, matrix languages, and more

Matrix minimization by row (retained)

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Matrix minimization by row (retained)

Hi there,

 

I´m using IML/SAS in SAS Enterprise Guide. 

Is there any solution that allows us to obtain Matrix B after apply retained minimization on Matrix A by row (see below)?

 

Thank you very much!

iml_problem.png

 

 


Accepted Solutions
Solution
‎02-27-2017 09:06 PM
SAS Super FREQ
Posts: 3,233

Re: Matrix minimization by row (retained)

Use the elementwise minimum operator (><) as explained in this blog post:

 

 

proc iml;
A ={
94 19 89 73 78 33 87 73  8 85 80 43  0,
92 95 69 64 32 11 30 18 11 75 82 48 99,
34 92 58 80 24 68 34 98 87 41 18 34  5};

B = A;
do j = 2 to ncol(A);
   B[,j] = (B[,j-1] >< B[,j]);
end;
print B;

 

View solution in original post


All Replies
Solution
‎02-27-2017 09:06 PM
SAS Super FREQ
Posts: 3,233

Re: Matrix minimization by row (retained)

Use the elementwise minimum operator (><) as explained in this blog post:

 

 

proc iml;
A ={
94 19 89 73 78 33 87 73  8 85 80 43  0,
92 95 69 64 32 11 30 18 11 75 82 48 99,
34 92 58 80 24 68 34 98 87 41 18 34  5};

B = A;
do j = 2 to ncol(A);
   B[,j] = (B[,j-1] >< B[,j]);
end;
print B;

 

New Contributor
Posts: 2

Re: Matrix minimization by row (retained)

Thank you 

 

Post a Question
Discussion Stats
  • 2 replies
  • 173 views
  • 2 likes
  • 2 in conversation