Home > Scripts > Models > Factory > gaussnd.m



y = gaussnd(p, x, y, ..., signal) : nD Gaussian


function y=gaussnd(varargin)


 y = gaussnd(p, x, y, ..., signal) : nD Gaussian

   iFunc/gaussnd nD Gaussian fitting function

     y = R0 * exp(-[x,y,...]' * G * [x,y,...]) 

 a multi-dimensional Gaussian profile

 This model has no background, is centered, and has maximum intensity set to 1.
 The parameters correspond to widths.

 gaussnd([w1 w2 ... wn ])
   builds a 'n' Dimensional orthogonal Gaussian with widths [w1 w2 ...]
   where M is a square matrix [n x n] builds a 'n' Dimensional.
   if M is non symmetric, it is made so from (M+M')/2
 gaussnd('ResLibCal') extracts a 4D TAS resolution function from ResLibCal
   builds a 2D Gaussian
   shows a Dialogue to enter the Gaussian matrix, widths or other option.

 input:  p: Gaussian model matrix (double, symmetric ndims*ndims)
            p = [ ndims(G) * ndims(G) values ]
          or 'guess'
         x,y,...: axes (double)
         signal: when values are given and p='guess', a guess of the parameters is performed (double)
 output: y: model value
 ex:     y=gaussnd([1 0 1 1], -10:10, -10:10); or plot(gaussnd)

 Version: Aug. 22, 2017
 See also iFunc, iFunc/fits, iFunc/plot, gauss2d, gauss
 (c) E.Farhi, ILL. License: EUPL.


This function calls: This function is called by:
Generated on Tue 22-Aug-2017 11:03:30 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1