This MATLAB function returns a full column vector of the nonzero elements in A, ordered by columns.
www.mathworks.com