Testpeakdefs: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Jeremy No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Checks peak parameters in a peak definition structure. | Checks peak parameters in a peak definition structure. | ||
===Synopsis=== | ===Synopsis=== | ||
: [out,msg,loc] = testpeakdefs(peakdef) | : [out,msg,loc] = testpeakdefs(peakdef) | ||
===Description=== | ===Description=== | ||
Checks the consistency of the peak definitions in a peak definition structure and is useful for checking the initial guess for <tt>peakdef</tt>. This function examines each record of a peak definition structure <tt>peakdef</tt> and determines: | |||
1) if the lower bounds are lower than the initial guess (any parameters lower than the lower bounds is an error), | 1) if the lower bounds are lower than the initial guess (any parameters lower than the lower bounds is an error), | ||
2) if the upper bounds are higher than the initial guess (any parameters higher than the upper bounds is an error), and | 2) if the upper bounds are higher than the initial guess (any parameters higher than the upper bounds is an error), and | ||
3) if the number of parameters in each peak definition are consistent with the corresponding peak function (peakdef.fun field). | 3) if the number of parameters in each peak definition are consistent with the corresponding peak function (peakdef.fun field). | ||
* peakdef.fun = a multi-record peak definition structure array where each record is a peak definition. | ====Inputs==== | ||
* out = output status code: | * '''peakdef.fun''' = a multi-record peak definition structure array where each record is a peak definition. | ||
====Outputs==== | |||
* msg = error message (last error detected). | |||
* loc = location of detected problems. This is a two-column matrix with column one corresponding to a peak with an inconsistent definition, and column two corresponding to the inconsistent parameter definition (e.g. a paramter is < its lower bound). | * '''out''' = output status code: | ||
::'''0''' = no problems discovered. | |||
::'''-1''' = problem encountered. | |||
* '''msg''' = error message (last error detected). | |||
* '''loc''' = location of detected problems. This is a two-column matrix with column one corresponding to a peak with an inconsistent definition, and column two corresponding to the inconsistent parameter definition (e.g. a paramter is < its lower bound). | |||
If column two has a zero, this means that there is a peak definition with an inaccurate number of parameters for the specific peak shape (e.g. for peakdef.fun = Gaussian there are 3 parameters). | |||
===See Also=== | ===See Also=== | ||
[[peakstruct]] | [[peakstruct]] |
Latest revision as of 13:54, 9 October 2008
Purpose
Checks peak parameters in a peak definition structure.
Synopsis
- [out,msg,loc] = testpeakdefs(peakdef)
Description
Checks the consistency of the peak definitions in a peak definition structure and is useful for checking the initial guess for peakdef. This function examines each record of a peak definition structure peakdef and determines:
1) if the lower bounds are lower than the initial guess (any parameters lower than the lower bounds is an error),
2) if the upper bounds are higher than the initial guess (any parameters higher than the upper bounds is an error), and
3) if the number of parameters in each peak definition are consistent with the corresponding peak function (peakdef.fun field).
Inputs
- peakdef.fun = a multi-record peak definition structure array where each record is a peak definition.
Outputs
- out = output status code:
- 0 = no problems discovered.
- -1 = problem encountered.
- msg = error message (last error detected).
- loc = location of detected problems. This is a two-column matrix with column one corresponding to a peak with an inconsistent definition, and column two corresponding to the inconsistent parameter definition (e.g. a paramter is < its lower bound).
If column two has a zero, this means that there is a peak definition with an inaccurate number of parameters for the specific peak shape (e.g. for peakdef.fun = Gaussian there are 3 parameters).