How to get the max values of each row in each matrix
How to get the max values of each row in each matrix
So I am having a problem finding out how to get the maximum value in each row of a matrix. So for example say I had a 3x3 matrix with the first row being 1,2,3. The second row is 3,2,1 and finally the third row is 2,1,3. I would like to get a 3x1 vector that has values of 3,3,3.
Re: How to get the max values of each row in each matrix
compute [rect] x=%ranmat(3,3)
*
dec vect rowmax(%rows(x))
ewise rowmax(i)=%maxvalue(%xrow(x,i))
*
dec vect rowmax(%rows(x))
ewise rowmax(i)=%maxvalue(%xrow(x,i))