function x=vec(T); [a,b]=size(T); x=reshape(T,a*b,1);