title: Gaussian Blobs in MATLAB
body: <p>I am trying to produce Gaussian blobs of different intensities (black, gray, white) and contrasts but then, which parameter am I supposed to change in the code below?</p>
  
  <p>Many thanks in advance!</p>
  
  <pre><code>imSize = 300;                           % image size: n X n
  lamda = 10;                             % wavelength (number of pixels per cycle)
  theta = 15;                              % grating orientation
  sigma = 50;
  
  imSize = 300;
  % make linear ramp
  X = 1:imSize;                           % X is a vector from 1 to imageSize
  X0 = (X / imSize) - .5;                 % rescale X -&gt; -.5 to .5
  [Xm Ym] = meshgrid(X0, X0);
  s = sigma / imSize;  
  
  gauss = exp( -(((Xm.^2)+(Ym.^2)) ./ (2* s^2)) ); % formula for 2D gaussian
  %%%%%%% NEW VARIABLES
  trim = .005;                             % trim off gaussian values smaller than this
  gauss(gauss &lt; trim) = 0;                 % trim around edges (for 8-bit colour displays)
  
  imagesc( gauss, [-1 1] );                        % display
  colormap gray(256);
  axis off; axis image;     % use gray colormap
  </code></pre>