Testpeakdefs
Contents |
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).