function lind = linearIndex(A, row, col)
%LINEARINDEX Linear index from row and column indexes
%   lind = linearIndex(A, row, col) returns the linear index
%   corresponding to the given row and column indexes for the 
%   matrix A.

[rows, cols] = size(A);
lind = rows * (col - 1) + row;
