Peakstruct: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Makes an empty standard peak definition structure.
Makes an empty standard peak definition structure.
===Synopsis===
===Synopsis===
:peakdef = peakstruct(fun,n)
:peakdef = peakstruct(fun,n)
===Description===
===Description===
The output of PEAKSTRUCT is an empty standard peak structure, or multi-record peak structure.  
The output of PEAKSTRUCT is an empty standard peak structure, or multi-record peak structure.  
No input is required. Optional inputs can be used to create different types of default peak definitions in each of the structure records.
No input is required. Optional inputs can be used to create different types of default peak definitions in each of the structure records.
OPTIONAL INPUTS:
 
* fun = Peak function name {default = 'Gaussian'}. Available peak names (shapes) are:
====Optional Inputs====
*  'Gaussian', 'Lorentzian', 'PVoigt1', and 'PVoigt2'.
 
* n = Number of records to include in the (peakdef) structure.
* '''fun''' = Peak function name {default = 'Gaussian'}. Available peak names (shapes) are:
OUTPUTS:
 
* peakdef = A structure array with the following fields:
''''Gaussian',''' 'Lorentzian', 'PVoigt1', and 'PVoigt2'.
* name: 'Peak', indentifies (peakdef) as a peak definition structure.
 
* id: integer or character string peak identifier.
* '''n''' = Number of records to include in the (peakdef) structure.
* fun: peak function name {e.g.'Gaussian'}.
 
* param:  vector of parameters for each peak function:
====Outputs====
* fun = 'Gaussian'; param = [height, position, width].
 
* fun = 'Lorenzian'; param = [height, position, width].
* '''peakdef''' = A structure array with the following fields:
* fun = 'PVoigt1'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
 
* fun = 'PVoigt2'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
* '''name''': 'Peak', indentifies (peakdef) as a peak definition structure.
*  Descriptions of the functions and parameters are given in the Algorithm section of the FITPEAKS entry in the reference manual. Also see PEAKFUNCTION.
 
* lb:  vector of lower bounds on (.param).
* '''id''': integer or character string peak identifier.
* penlb:  vector of penalties for lower bounds. If an entry is 0, then the corresponding lower bound is not active.
 
* ub:  vector of upper bounds on (.param).
* '''fun''': peak function name {e.g.'Gaussian'}.
* penub:  vector of penalties for upper bounds. If an entry is 0, then the corresponding upper bound is not active.
 
* '''param''':  vector of parameters for each peak function:
 
* '''fun''' = 'Gaussian'; param = [height, position, width].
 
* '''fun''' = 'Lorenzian'; param = [height, position, width].
 
* '''fun''' = 'PVoigt1'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
 
* '''fun''' = 'PVoigt2'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
 
'''Descriptions''' of the functions and parameters are given in the Algorithm section of the FITPEAKS entry in the reference manual. Also see PEAKFUNCTION.
 
* '''lb''':  vector of lower bounds on (.param).
 
* '''penlb''':  vector of penalties for lower bounds. If an entry is 0, then the corresponding lower bound is not active.
 
* '''ub''':  vector of upper bounds on (.param).
 
* '''penub''':  vector of penalties for upper bounds. If an entry is 0, then the corresponding upper bound is not active.
 
===Examples===
===Examples===
:peakdef = peakstruct('',3);
 
:disp(peakdef(2))
peakdef = peakstruct('',3);
:peakdef(2) = peakstruct('PVoigt1');
disp(peakdef(2))
:peakdef(2).id = '2: Voigt';
peakdef(2) = peakstruct('PVoigt1');
:disp(peakdef(2))
peakdef(2).id = '2: Voigt';
disp(peakdef(2))
 
===See Also===
===See Also===
[[fitpeaks]], [[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakstruct]], [[peakpvoigt1]], [[peakpvoigt2]]
[[fitpeaks]], [[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakstruct]], [[peakpvoigt1]], [[peakpvoigt2]]

Latest revision as of 13:24, 9 September 2008

Purpose

Makes an empty standard peak definition structure.

Synopsis

peakdef = peakstruct(fun,n)

Description

The output of PEAKSTRUCT is an empty standard peak structure, or multi-record peak structure.

No input is required. Optional inputs can be used to create different types of default peak definitions in each of the structure records.

Optional Inputs

  • fun = Peak function name {default = 'Gaussian'}. Available peak names (shapes) are:
  • 'Gaussian', 'Lorentzian', 'PVoigt1', and 'PVoigt2'.
  • n = Number of records to include in the (peakdef) structure.

Outputs

  • peakdef = A structure array with the following fields:
  • name: 'Peak', indentifies (peakdef) as a peak definition structure.
  • id: integer or character string peak identifier.
  • fun: peak function name {e.g.'Gaussian'}.
  • param: vector of parameters for each peak function:
  • fun = 'Gaussian'; param = [height, position, width].
  • fun = 'Lorenzian'; param = [height, position, width].
  • fun = 'PVoigt1'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
  • fun = 'PVoigt2'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1.
  • Descriptions of the functions and parameters are given in the Algorithm section of the FITPEAKS entry in the reference manual. Also see PEAKFUNCTION.
  • lb: vector of lower bounds on (.param).
  • penlb: vector of penalties for lower bounds. If an entry is 0, then the corresponding lower bound is not active.
  • ub: vector of upper bounds on (.param).
  • penub: vector of penalties for upper bounds. If an entry is 0, then the corresponding upper bound is not active.

Examples

peakdef = peakstruct(,3);
disp(peakdef(2))
peakdef(2) = peakstruct('PVoigt1');
peakdef(2).id = '2: Voigt';
disp(peakdef(2))

See Also

fitpeaks, peakfunction, peakgaussian, peaklorentzian, peakstruct, peakpvoigt1, peakpvoigt2