setFunctionDefault - Set default function customization template and memory section for model functions

  category - MATLAB ([original](https://in.mathworks.com/help/ecoder/ref/coder.mapping.api.coderdictionary.setfunctiondefault.html)) ([raw](?raw))

Main Content

Set default function customization template and memory section for model functions category

Since R2021a

Syntax

Description

setFunctionDefault([myCoderDictionaryObj](#mw%5F90194fa6-0109-4bc0-bf9d-8461a2215cdd),[category](#mw%5Fc8d3c427-db6c-4982-b007-4ac9630219e2),[Name,Value](#namevaluepairarguments)) sets the default function customization template and memory section for the specified category of model entry-point functions.

example

Examples

collapse all

Use the coder.mapping.api.get function to access theCoderDictionary object associated with the data dictionary.

cm = coder.mapping.api.get('codeDefinitions.sldd');

To see the memory section for Execution functions in the dictionary, use the getFunctionDefault function.

value = getFunctionDefault(cm, 'Execution', 'MemorySection')

To configure the memory section for the category, use thesetFunctionDefault function.

setFunctionDefault(cm, 'Execution', 'MemorySection', 'functionFastMem')

To verify that the memory section for the Execution category is now set to functionFastMem, use thegetFunctionDefault function.

value = getFunctionDefault(cm, 'Execution', 'MemorySection')

value =

'functionFastMem'

Input Arguments

collapse all

Coder dictionary object returned by a call to functioncoder.mapping.api.get.

Category of model entry-point functions for which to set the function customization template and memory section.

Example: 'Execution'

Name-Value Arguments

collapse all

Example: 'FunctionCustomizationTemplate' 'exFastFunction'

Specify comma-separated pairs of Name,Value arguments.Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments as Name1,Value1,…,NameN,ValueN. The order of the name and value pair arguments does not matter.

Name of a function customization template defined in the Embedded Coder Dictionary associated with the model. If you set the default function customization template for a category of functions to Default, you can specify a memory section for the category of functions.

Data Types: char | string

Name of a memory section that is defined in the Embedded Coder Dictionary associated with the model.

Data Types: char | string

Version History

Introduced in R2021a