% before mesh grid (home-made mesh grid maker) % % mesh_grid.m % This comes from Opt/wavef5.m % (L. Kocbach about 1996) % (Flipped from rows to columns) % % This can be replaced by call to meshgrid % % x1=1:n; % x2=-n:-1; % [X1,X2 ]=meshgrid(x1,x2); % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% n=5; x1=1:n; x2=-n:-1; % row vectors x1 and x2 X1=zeros(n,n); % fill the matrices by zeros X2=zeros(n,n); %%%%%%%%%%% The code below suits FORTRAN 90 %%%%%%%%%%%%%%% for ix1=1:n; X1(ix1,:)=x1 ; end; % x1 placed as rows for ix2=1:n; X2(:,ix2)=x2'; end; % x2 placed as columns %%%% The mesh is constructed format compact; x1 x2 X1 X2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%