Main Content

Specify by function

Description

Specify the array layout for each external C function used by the C Caller block.

Category: Simulation Target

Settings

Specify the array layout for each external C function used by the C Caller block. The array layout specified for an individual function takes precedence over the option specified in Default function array layout parameter. Use these options to add or remove the array layout setting for an individual C function:

Add

Add custom C function used by the C Caller block and specify the array layout setting.

Remove

Remove the custom C function used by the C Caller block.

Command-Line Information

Parameter: CustomCodeFunctionArrayLayout
Type: structure array
Value: structure with 'FunctionName' and 'ArrayLayout' fields. 'ArrayLayout' can be 'Column-major', 'Row-major' or 'Any'.
Default: ' '

Example

Consider a model foo_model. If you have external C functions that you interface with the model by using the C Caller block, use these commands in MATLAB® command window to specify array layouts for these functions:

arrayLayout(1).FunctionName = 'MyCFunction1';
arrayLayout(1).ArrayLayout = 'Column-major';
arrayLayout(2).FunctionName = 'MyCFunction2';
arrayLayout(2).ArrayLayout = 'Row-major';
set_param('foo_model', 'CustomCodeFunctionArrayLayout', arrayLayout)

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo recommendation
Safety precautionNo recommendation

Related Topics