function vmat = VtoVMat(n,m,V) for j=1:m for i=1:n vmat(j,i)=V((m-j)*n+i); end end return end