getData
Description
returns the code mapping information for the property specified by
value
= getData(myCPPMappingObj
, category
, property
)property
and the model data category specified by
category
.
Examples
Get Data Visibility of Model Parameters
Get the data visibility of model parameters.
Open the model. Use the coder.mapping.api.get
function to access the CodeMappingCPP
object associated with the model.
open_system('CppClassRateBased'); cm = coder.mapping.api.get('CppClassRateBased');
To view the data visibility of the model parameters, use the getData
function.
value = getData(cm, 'ModelParameters', 'DataVisibility')
value = 'public'
To configure the data visibility, specify the 'DataVisibility'
parameter by using the setData
function.
setData(cm, 'ModelParameters', 'DataVisibility', 'private');
Input Arguments
myCPPMappingObj
— C++ code mapping object
CodeMappingCPP
object
C++ code mapping object, returned by a call to either the coder.mapping.utils.create
function or the coder.mapping.api.get
function.
category
— Category of model data
'Inports'
| 'Outports'
| 'ModelParameters'
| 'ModelParameterArguments'
| 'InternalData'
Category of model data to access, specified as one of these categories.
Category | Description |
---|---|
'Inports' | Root-level input ports of a model, such as Inport and In Bus Element blocks. |
'Outports' | Root-level output ports of a model, such as Outport and Out Bus Element blocks. |
'ModelParameters' | Parameters that are defined within a model, such as parameters in the model workspace. Excludes model arguments. |
'ModelParameterArguments' | Parameters in the model workspace configured as model arguments. These parameters are exposed at the model block to enable each model instance to provide its own value. |
'InternalData' | Data elements that are internal to a model, such as block output signals, discrete block states, data stores, and zero-crossing signals. |
Data Types: char
| string
property
— Property of model data
'MemberAccessMethod'
| 'DataVisibility'
| 'DataAccess'
Property of model data to access, specified as
'MemberAccessMethod'
, 'DataVisibility'
, or
'DataAccess'
.
The MemberAccessMethod
property specifies how the methods, if
any, are generated for the data elements.
The DataVisibility
property specifies the visibility
(private
, public
, or
protected
) of the data category in the generated code.
The DataAccess
property specifies whether model elements are
stored by value ('Direct'
) or pointer ('Pointer'
)
in the generated code. Data access is configurable for 'Inports'
,
'Outports'
, and 'ModelParameterArguments'
categories:
'Inports'
whose member access method is set to'Structure-based method'
or'Inlined structure-based method'
.'Outports'
whose member access method is set to'Structure-based method'
or'Inlined structure-based method'
.'ModelParameterArguments'
whose data visibility is set to'private'
(not'Individual Arguments'
).
Data Types: char
| string
Output Arguments
value
— Code mapping property value of category
character vector
The code mapping property value of the specified category, returned as a character vector.
Version History
Introduced in R2021a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)