Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Row wise operations in octave

Tags:

matlab

octave

Is there a way to perform row wise operations on matrices in octave ?

I have a (mXn) matrix of integers, can i obtain a m dimensional vector where each element is the maximum element of the corresponding row ? How can i do this in octave ?

like image 823
nik7 Avatar asked Apr 09 '12 07:04

nik7


1 Answers

In matlab, for a 2D array A, this would be

max(A,[],2)

and if you want to know the index of found the value:

[value,index]=max(A,[],2)
like image 108
High Performance Mark Avatar answered Nov 03 '22 18:11

High Performance Mark