Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Math Forum
»
Discussions
»
Software
»
comp.softsys.matlab
Notice: We are no longer accepting new posts, but the forums will continue to be readable.
Topic:
use function find to search for multiple values
Replies:
1
Last Post:
Nov 18, 2014 4:48 PM



Ki
Posts:
21
Registered:
5/20/12


use function find to search for multiple values
Posted:
Nov 18, 2014 4:41 PM


Hi there, I have a matrix A which is 1024x810. For each row, I need to find the maximum value and then locate the position of the maximum value on each row. I am thinking of the following code
A = rand(1024, 810); find(A==max(A, [], 2))
but this doesn't work. If I use a loop to search one row at a time, it return the position as expected but it is quite slow to use a loop since above operation will be performed so many times. Any idea to do it faster? Thanks



