getClassName - Get class name of model - MATLAB (original) (raw)
Main Content
Get class name of model
Since R2021a
Syntax
Description
[name](#mw%5F1ca29c2a-5626-4566-ba5a-782fccc35df7) = getClassName([myCPPMappingObj](#mw%5F8fd57b10-199f-4439-b1b1-4ce2feef9f4d))
returns the class name of the model.
Examples
Open the model. To access the CodeMappingCPP
object associated with the model, use the coder.mapping.api.get
function.
open_system('CppClassRateBased'); cm = coder.mapping.api.get('CppClassRateBased');
Use the getClassName
function to get the class name of the model.
If you did not specify a class name for the model, the getClassName
function returns an empty character vector and the class name in the generated code uses the model name as the default class name.
Specify a class name for the model by using the setClassName
function.
setClassName(cm, 'myClassName');
The getClassName function now returns the specified class name.
Input Arguments
Output Arguments
Class name of model, returned as a character vector. If you do not specify a class name, the class name in the generated code uses the name of the model as the default class name.
Version History
Introduced in R2021a