function x=grid2vector(z,G);
% x=grid2vector(z,G)
% Forms a vector x from z placed as G
x(G(G~=0))=z(G~=0);
x=x.';
