Main Content

setDataDefault

Set default storage class and storage class property values for model data category

Since R2020b

    Description

    example

    setDataDefault(myCodeMappingObj,category,Name,Value) sets the default storage class and storage class property values in the code mappings for the specified category of model data.

    You cannot specify default data interfaces for models with an attached Embedded Coder Dictionary that defines a service interface configuration.

    Examples

    collapse all

    In the model code mappings for model myConfigModel, configure the default representation of model workspace parameters in generated code as unstructured global variables by setting the default storage class to ExportedGlobal.

    cm = coder.mapping.api.get('myConfigModel');
    setDataDefault(cm,'ModelParameters','StorageClass','ExportedGlobal');
    

    Input Arguments

    collapse all

    Code mapping object (model code mappings) returned by a call to function coder.mapping.api.get.

    Example: myCM

    Category of model data element for which to set the storage class and storage class properties.

    Example: 'Inports'

    Name-Value Arguments

    Example: 'StorageClass','ExportedGlobal'

    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.

    Storage class to set for the specified data element category. The name of a predefined storage class or storage class that is defined in the Embedded Coder Dictionary associated with the model. Values that you can specify vary depending on the category that you specify. See Choose Storage Class for Controlling Data Representation in Generated Code.

    Example: 'StorageClass','ImportedExtern'

    Version History

    Introduced in R2020b