Documentation

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

指针to local function.

fcnVisibility

Enumerated typeSSSimulinkFunctionVisibilitywith two permissible values,SS_SCOPED_VISIBILITYandSS_GLOBAL_VISIBILITY.

Returns

No return value.

Description

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

Languages

C, C++

Example

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

Introduced in R2018a