Main Content

ssDeclareSimulinkFunction

Declare Simulink Function with a given function prototype and scope.

Syntax

void ssDeclareSimulinkFunction(SimStruct *S, char *fcnPrototype, SSSimulinkFunctionPtr fcnPtr, SSSimulinkFunctionVisibility fcnVisibility)

Arguments

S

SimStruct representing an S-Function block.

fcnPrototype

Interface between a function caller and a Simulink Function.

fcnPtr

Pointer to local function.

fcnVisibility

Enumerated type SSSimulinkFunctionVisibility with two permissible values, SS_SCOPED_VISIBILITY and SS_GLOBAL_VISIBILITY.

Returns

No return value.

Description

char fcnPrototype[] = "y = timestwo(u)";
ssDeclareSimulinkFunction(S, fcnPrototype, "timestwo", SS_GLOBAL_VISIBILITY);

Languages

C, C++

Example

The model sfcndemo_simulinkfunction_getset is an S-function example that models an object with get and set methods using two scoped Simulink Functions.

Introduced in R2018a