Contenido principal

getFunctionDefault

R2026b

Get default function customization template or memory section for model functions category

    Description

    propertyValue = getFunctionDefault(myCoderDictionaryObj,category,property) returns the value of the specified property for the specified function category.

    example

    Examples

    collapse all

    View and modify function defaults of an Embedded Coder® dictionary configured with data interface configuration.

    Use the function Simulink.data.dictionary.create to create the dictionary file dataDict.sldd and the associated Simulink.data.Dictionary object. Then use the function coder.dictionary.create to create the data interface Embedded Coder dictionary object, and store handles to the objects in variables.

    dictFile = "dataDict.sldd";
    simDictObj = Simulink.data.dictionary.create(dictFile);
    ecoderDataDictObj = coder.dictionary.create(dictFile,"DataInterface");

    Use the function coder.mapping.api.get() with the Simulink.data.Dictionary object to get a handle to the mapping object of the dictionary mapping object and store it in the variable dictMapObj.

    dictMapObj = coder.mapping.api.get(simDictObj);

    Use the function setFunctionDefault to set the default dictionary value for the memory section of the execution function category. Then use the function getFunctionDefault to verify that the default has been updated.

    setFunctionDefault(dictMapObj,"Execution",MemorySection="MemConst")
    getFunctionDefault(dictMapObj,"Execution","MemorySection")
    ans = 'MemConst

    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"

    FunctionCustomizationTemplate or MemorySection for which to return a value.

    Example: "FunctionCustomizationTemplate"

    Output Arguments

    collapse all

    Name of the function customization template or memory section.

    Data Types: char | string

    Version History

    Introduced in R2021a