pne_register_events

pne_register_events(my_events, opt, reg_ev)

pne_register_events() - Register PNE event functions.

REG_EV = PNE_REGISTER_EVENTS(MY_EVENTS, OPT)
REG_EV = PNE_REGISTER_EVENTS(MY_EVENTS, OPT, REG_EV)

Registers event functions to be called by PNES_MASTER.

Inputs:
    MY_EVENTS : a cell array of the form {NAME, FCN, TOL, LOCATE}, or
        a cell array of such cell arrays, TOL and LOCATE are optional:
        NAME - char array with a unique event name
        FCN - function handle to the event detection function
        TOL (OPT.default_event_tol) - optional, scalar or vector of same
            dimension as event function return value of tolerance for
            detecting the event, i.e. abs(val) <= tol
        LOCATE (1) - optional, flag indicating whether the event requests
            a rollback step to locate the event function zero
    OPT - PNES_MASTER options struct
    REG_EV : (optional) struct array containing existing registered event
        functions

Outputs:
    REG_EV : updated struct containing registered event functions, with
        fields name, fcn, tol, locate, corresponding to respective inputs

User Defined PNES_MASTER Event Functions:
    The user can define their own event detection functions which take
    the same form as PNE_EVENT_TARGET_LAM. These are specified via the
    'events' option (OPT.events) to PNES_MASTER, which takes the same
    form as MY_EVENTS above.

See also pnes_master(), pne_event_nose(), pne_event_target_lam().