MPT_NONLINFCN Template function for (piecewise) nonlinear systems This is a template function for defining nonlinear or piecewise nonlinear systems. The function is divided into four main parts which are executed depending on the value of the "flag" input. In the "info" part, the user provides parameters which define system dimensions and constraints. If certain constraints are not known, or the user does not want to impose them, respective fields can be defined as empty matrices. In the "state" part, the state update equations are specified as (possibly nonlinear) functions of the states (denoted by "x") and inputs (denoted by "u"). If the system is piecewise nonlinear, one state update equation per each segment must be specified. Index of a respective segment is provided in the "mode" variable. The purpose of the "output" section is to define the output equation as a function of system states and system inputs. Again, one output equation per segment must be given if the system is piecewise nonlinear. Finally, the "guards" section specifies portions of the state-input space where a given segment (one piece of the piecewise nonlinear dynamics) is active. The equations can again be specified using the state and input variables. To create a system structure based on this template, simply call following command: sysStruct = mpt_sys(@function_name)