I have a matrix, N, and a matrix RC, and what I want is to search for a minimum value in N based on values in RC for rows and columns. Each value in RC specifies a row and col that needs to be searched in N with column 1 representing row values and column 2 representing col values. How would I go about doing this? I tried doing
[minval, minidx] = min(min(N(RC(:,1), RC(:,2))))
but it is producing incorrect results leading me to believe there is an error in my logic. rmin and cmin are 2 and 1, respectively, which is not a pair in the RC matrix.