Code covered by the BSD License
function n=grid2n(i,j,Nj) n=i+(j-1)*Nj;
Contact us at files@mathworks.com