Stationary Gaussian Random Fields

Below is code to generate stationary Gaussian random fields (GRF) on an interval or a rectangle in Matlab.
(These notes and examples were made during Canada/USA Mathcamp 2008.)