flatten.m 176 B

12345678910111213
  1. function f = flatten(m)
  2. % function f = flatten(m)
  3. %
  4. % <m> is a matrix
  5. %
  6. % return as a row vector.
  7. %
  8. % example:
  9. % a = [1 2; 3 4];
  10. % isequal(flatten(a),[1 3 2 4])
  11. f = m(:).';