Open the model. To access the CodeMappingCPP object associated with
the model, use the coder.mapping.api.get function.
open_system('rtwdemo_cppclass');
cm = coder.mapping.api.get('rtwdemo_cppclass');
To access the class name of the model, use the getClassName
function. 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.
name = getClassName(cm)
name =
0×0 empty char array
Specify a class name for the model by using the setClassName
function.
setClassName(cm, 'myClassName');
The getClassName function now returns the specified class
name.
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.
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.