from
flat
by Vincent flatten a matrix, i.e. make it a vector
x=flat(x)
function x=flat(x)
% x = flat(x)
% flatten a matrix.
% useful when you can't append "(:)" to an expression
% e.g. flat(x(index,:))
% dumb but convenient
% Vincent Noel 2007
x = x(:);
return