% trigfield6.m investigates the joint distribution of F(0,0) and F(x,y) m = 20; % number of Fourier modes Cmax = 1000; % number of iid replications x = 0.5; y = 0.1; F = []; for C = 1:Cmax, A = randn(1,m)*sqrt(2/m); % amplitudes of Fourier modes phi = 2 * pi * rand(m,1); % random phase norm = sqrt(-2*log(rand(m,1))); % magnitudes of wave numbers theta = 2 * pi * rand(m,1); % arguments of wave numbers K = [norm.*cos(theta) norm.*sin(theta)]; % isotropic wave numbers F(C,1) = A * cos(phi); % field value at (0,0) F(C,2) = A * cos(K*[x; y] + phi); % field value at (x,y) end clf plot(F(:,1), F(:,2),'*'); xlabel('Value at (0,0)'); ylabel('Value at (x,y)');