主要内容

coder.MATLABCodeTemplate.setTokenValue

类: coder.MATLABCodeTemplate
命名空间: coder

设置代码生成模板的标记值

语法

setTokenValue(tokenName,tokenValue)

说明

setTokenValue(tokenName,tokenValue) 设置代码生成模板的标记值。

输入参数

tokenName

标记的名称

tokenValue

标记的值

默认:

示例

从自定义模板创建一个 MATLABCodeTemplate 对象。设置模板中自定义标记的值。

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