Peakstruct: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
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==== | ====OPTIONAL INPUTS==== | ||
* '''fun''' = Peak function name {default = 'Gaussian'}. Available peak names (shapes) are: | * '''fun''' = Peak function name {default = 'Gaussian'}. Available peak names (shapes) are: | ||
* ''''Gaussian',''' 'Lorentzian', 'PVoigt1', and 'PVoigt2'. | * ''''Gaussian',''' 'Lorentzian', 'PVoigt1', and 'PVoigt2'. | ||
* '''n''' = Number of records to include in the (peakdef) structure. | * '''n''' = Number of records to include in the (peakdef) structure. | ||
====OUTPUTS==== | ====OUTPUTS==== | ||
* '''peakdef''' = A structure array with the following fields: | * '''peakdef''' = A structure array with the following fields: | ||
* '''name''': 'Peak', indentifies (peakdef) as a peak definition structure. | * '''name''': 'Peak', indentifies (peakdef) as a peak definition structure. | ||
* '''id''': integer or character string peak identifier. | * '''id''': integer or character string peak identifier. | ||
* '''fun''': peak function name {e.g.'Gaussian'}. | * '''fun''': peak function name {e.g.'Gaussian'}. | ||
* '''param''': vector of parameters for each peak function: | * '''param''': vector of parameters for each peak function: | ||
* '''fun''' = 'Gaussian'; param = [height, position, width]. | * '''fun''' = 'Gaussian'; param = [height, position, width]. | ||
* '''fun''' = 'Lorenzian'; param = [height, position, width]. | * '''fun''' = 'Lorenzian'; param = [height, position, width]. | ||
* '''fun''' = 'PVoigt1'; param = [height, position, width, fraction Gaussian], where 0 fraction Gaussian 1. | * '''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. | * '''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. | * '''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). | * '''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. | * '''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). | * '''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. | * '''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); | :peakdef = peakstruct('',3); | ||
:disp(peakdef(2)) | :disp(peakdef(2)) | ||
:peakdef(2) = peakstruct('PVoigt1'); | :peakdef(2) = peakstruct('PVoigt1'); | ||
:peakdef(2).id = '2: Voigt'; | :peakdef(2).id = '2: Voigt'; | ||
:disp(peakdef(2)) | :disp(peakdef(2)) | ||
===See Also=== | ===See Also=== | ||
[[fitpeaks]], [[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakstruct]], [[peakpvoigt1]], [[peakpvoigt2]] | [[fitpeaks]], [[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakstruct]], [[peakpvoigt1]], [[peakpvoigt2]] |
Revision as of 15:26, 3 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