This example shows how to specify alias data types in a C Function block. The model reads in a source and header file from the Configuration Parameters > Simulation Target pane. Calculations are performed using the functions in the source file.
Simulink.importExternalCTypes('multiply_func.h'); open_system('mCFunction_AliasType');
To define an alias type in your C source code to be used in your C Function
block, use the typedef
keyword. In this example, a double alias is defined as typedef double doubleAlias
in the multiply_func.h
file.
You must define your symbols in the Symbols table of the C Function block parameters. Define the symbols in the block as alias types by entering the alias type in the Type column of the Symbols table.