%% Return Linear Indices
% Create a matrix A and return the minimum value of each row in the matrix M. Use the 'linear' option to also return the linear indices I such that M = A(I).

A = [1 2 3; 4 5 6]
[M,I] = min(A,[],2,'linear')
minvals = A(I)

% Copyright 2018 The MathWorks, Inc.