Main Content

coder.MATLABCodeTemplate Class

Namespace: coder

Represent code generation template for MATLAB Coder

Description

Create a coder.MATLABCodeTemplate object from a code generation template (CGT) file. You can use this file to customize the code generation output for MATLAB® Coder™. If a CGT file is not provided, the coder.MATLABCodeTemplate object is created from the default template file matlabroot/toolbox/coder/matlabcoder/templates/matlabcoder_default_template.cgt.

The coder.MATLABCodeTemplate class is a handle class.

Creation

Description

newObj = coder.MATLABCodeTemplate() creates a coder.MATLABCodeTemplate object from the default code generation template (CGT) file matlabroot/toolbox/coder/matlabcoder/templates/matlabcoder_default_template.cgt.

example

newObj = coder.MATLABCodeTemplate(CGTFile) creates a coder.MATLABCodeTemplate object from the code generation template file CGTFile. If the file is not on the MATLAB path, specify a full path to the file.

example

Input Arguments

expand all

Name of code generation template file, specified as a character vector.

Methods

expand all

Examples

collapse all

This example show how to create a coder.MATLABCodeTemplate object from the default code generation template (CGT) file matlabroot/toolbox/coder/matlabcoder/templates/matlabcoder_default_template.cgt

newObj = coder.MATLABCodeTemplate()
newObj = 

  MATLABCodeTemplate with properties:

    CGTFile: 'matlabcoder_default_template.cgt'

This example show how to create a coder.MATLABCodeTemplate object from a code generation template (CGT) file that you specify. If the file is not on the MATLAB path, you must specify a full path to the file.

newObj = coder.MATLABCodeTemplate('custom_matlabcoder_template.cgt')
newObj = 

  MATLABCodeTemplate with properties:

    CGTFile: 'custom_matlabcoder_template.cgt'

Version History

Introduced in R2014a