% direct_product_mesh.m % % This demonstrates meshgrid % % works in Matlab and Octave n=5; x1=1:n; x2=-n:-1; [X1,X2 ]=meshgrid(x1,x2); format compact; % Output part x1 x2 X1 X2