clear all; close all; N=512; %generate a 512 by 512 array of points x=0:(1/(N-1)):1; y=x; % x and y values between 0 and +1 spaced by % 1/N u = 520; %set the horizontal frequency parameter v = 520; % set the horizontal frequency parameter [X,Y]=meshgrid(x,y); % generate 2D grids of x,y values (N by N %arrays) X(i,j) = x(j) and Y(i,j) = y(i) Z=0.5*(1+cos(2*pi*(u*X+v*Y))); % generate the %sinusoidal function on the grid imshow(Z)