Main Content

coder.mapping.defaults.allowedProperties

Return properties for model default mapping category

Description

example

properties = coder.mapping.defaults.allowedProperties(model,category) returns a cell array of names for properties that are relevant to category for the specified model. Use the property names that the coder.mapping.defaults.allowedProperties function returns in subsequent calls to coder.mapping.defaults.allowedValues and coder.mapping.defaults.set.

Examples

collapse all

Get a list of the properties for the model default data categories Inports, Outports, ModelParameters, and InternalData by using calls to coder.mapping.defaults.allowedProperties.

Load the model.

open_system('rtwdemo_configdefaults');

Get a list of the properties for the model default data category Inports.

coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
 'Inports')
ans =

  3×1 cell array

    {'StorageClass'      }
    {'HeaderFile'        }
    {'PreserveDimensions'}

Get a list of the properties for the model default data category Outports.

coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
 'Outports')
ans =

  5×1 cell array

    {'StorageClass'      }
    {'HeaderFile'        }
    {'DefinitionFile'    }
    {'Owner'             }
    {'PreserveDimensions'}

Get a list of the properties for the model default data category ModelParameters.

coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
 'ModelParameters')
ans =

  1×1 cell array

    {'StorageClass'}

Get a list of the properties for the model default data category InternalData.

coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
 'InternalData')
ans =

  2×1 cell array

    {'StorageClass' }
    {'MemorySection'}

Get a list of the properties for the model default function categories InitializeTerminate and Execution by using calls to coder.mapping.defaults.allowedProperties.

Load the model.

open_system('rtwdemo_configdefaults');

Get a list of the properties for the model default function category InitializeTerminate.

catData = coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
  'InitializeTerminate');
catData
catData =

  1×1 cell array

    {'FunctionCustomizationTemplate'}

Get a list of the properties for the model default function category Execution.

catFunctions = coder.mapping.defaults.allowedProperties('rtwdemo_configdefaults',...
'Execution');
catFunctions
catFunctions =

  1×1 cell array

    {'FunctionCustomizationTemplate'}

Input Arguments

collapse all

Model file, specified as a character vector. The model must be loaded (for example, by using load_system) or open. You can omit the .slx file extension.

Example: 'myLoadedModel'

Data Types: char

Category name, specified as a character vector. To get valid data and function category names, call the functions coder.mappings.defaults.dataCategories and coder.mappings.defaults.functionCategories.

Example: 'Inports'

Data Types: char

Output Argument

collapse all

Cell array of names for properties of a default category for the specified model.

Introduced in R2018a