Main Content

setFunctionDefault

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

Since R2021a

    Description

    setFunctionDefault(myCoderDictionaryObj,category,Name,Value) 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 the CoderDictionary 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')
    value =
    
        'None'

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

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

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

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

    Input Arguments

    collapse all

    Coder dictionary object returned by a call to function coder.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

    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