Main Content
coder.MATLABCodeTemplate.setTokenValue
Class: coder.MATLABCodeTemplate
Namespace: coder
Set value of token for code generation template
Syntax
setTokenValue(tokenName,tokenValue)
Description
setTokenValue(
sets
the value of a token for a code generation template.tokenName
,tokenValue
)
Input Arguments
|
The name of the token |
|
The value of the token Default: empty |
Examples
Create a MATLABCodeTemplate object from a custom template. Set the value for a custom token in the template.
newObj = coder.MATLABCodeTemplate('myCGTFile'); % Create a MATLABCodeTemplate object from a custom template file newObj.setTokenValue('myCustomToken', 'myValue'); % Set the value of a custom token in the file newObj.getTokenValue('myCustomToken') % Check value of the custom token