Is there a way to efficiently find the index of the largest element in a matrix. For example, if I have a matrix like:
1 3 9 2 4 5 1 3 3
The largest element is the [1, 2] element which is equal to 9.
1 Answer
0
The column index (ci) and the row index (ri) of the largest element for the matrix 'x' can be found like this:
ci = maxindc( maxc( x ) );
ri = maxindc( x[.,ci] );
Your Answer
1 Answer
0
The column index (ci) and the row index (ri) of the largest element for the matrix 'x' can be found like this:
ci = maxindc( maxc( x ) );
ri = maxindc( x[.,ci] );