MATLAB Nexsys Model Function Definition

After the model definition line, the model file contains the definition of the function that implements the model code.

The second line in the model file must be the MATLAB function declaration line. The format of the function declaration line depends on the model type. Nexsys supports modeling of sources or input/output (I/O) model types, defined by the numbers of inputs and outputs.

A SOURCE model has no input ports (In_N =0) and one or more output ports (Out_N >0). A SOURC E model must have parameters NSAMP and SAMPLE_RATE in the parameter_list in the model definition line.

An I/O model has one or more input ports (In_N >0) and one or more output ports (Out_N >0). The format for the function declaration of an I/O model depends on whether or not it has a parameter_list in the model definition line.

For SOURCE UDMs the syntax for the function declaration line is:

function[outputs,SV] = function_name(parameters, SV, status_in)

For I/O UDMS with no parameter_list in the model definition line:

function[outputs,SV] = function_name(inputs, SV, status_in)

For I/O UDMS (In_N > 0) with a non-empty parameter_list in the model definition line:

function[outputs,SV] = function_name(inputs, parameters, SV, status_in)

The entries in the function declarations are defined as follows: