function x = vec(x)

[m,n] = size(x);
x = reshape(x,m*n,1);