Home > Scripts > Models > triangl.m

iFit/triangl

PURPOSE ^

y = triangl(p, x, [y]) : Triangular

SYNOPSIS ^

function y=triangl(varargin)

DESCRIPTION ^

 y = triangl(p, x, [y]) : Triangular

   iFunc/triangl Triangular fitting function
     y=(p(3)-sign(x-p(2)).*(x-p(2)))/p(3)^2;
     and y is set to the background outside the full width.

 triangl(width)          creates a model with a specified width
 triangl([ parameters ]) creates a model with specified model parameters

 input:  p: Triangular model parameters (double)
            p = [ Amplitude Centre HalfWidth BackGround ]
          or 'guess'
         x: axis (double)
         y: when values are given and p='guess', a guess of the parameters is performed (double)
 output: y: model value
 ex:     y=triangl([1 0 1 1], -10:10); or plot(triangl);

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

CROSS-REFERENCE INFORMATION ^

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