%% Convert Linear Indices to Subscripts for Matrix
% Convert the linear indices [3 4 5 6] to row and column subscripts in a 3-by-3 matrix. The mapping from linear indices to subscripts (indexing by position) is illustrated in the following.
%
%
% Create input vectors and perform the conversion.

ind = [3 4 5 6];
sz = [3 3];
[row,col] = ind2sub(sz,ind)

%
% Copyright 2019 The MathWorks, Inc.