Вы можете сделать это, используя в основном просто логическое индексирование
% Add a row index as a 4th column to A.
% This is so we can track the original row number as we filter A down.
A(:,4) = (1:size(A,1)).';
% Filter A to satisfy condition (1); column 1 value == column 2 value
Afilt = A( A(:,1) == A(:,2), : );
% Filter again to leave only the rows which satisfy condition (2)
% Also sort on column 3 so that row 1 has the lowest value in column 3
Afilt = sortrows( Afilt( Afilt(:,1) == max(Afilt(:,1)), : ), 3, 'ascend' );
% Get the first value in column 4, which corresponds to the lowest value in col 3
idx = Afilt(1,4);
Вы можете сделать все это в одну строку, но это не красиво, и вы вычисляете условие 1 дважды:
[~,idx] = min( A(:,3) .* 1./(A(:,1)==A(:,2) & A(:,1)==max(A(A(:,1)==A(:,2),1))) );