Main Content


Copy template file for class


copiedFilePath =,templateType)


copiedFilePath =,templateType) creates a copy of the default template file, of the specified type, for objects of the class in the folder specified by targetPath. Use the template copy as a starting point for creating your custom template.

Input Arguments

expand all

Target path for the copy of the template file, specified as a character vector or string scalar. If you specify targetPath without the file extension, the method creates the file with the extension of the copied template file. If you include the file extension, it must match the extension of the copied template file.

Data Types: char | string

Type of template to copy, specified as "html", "html-file", "docx", or "pdf".

Data Types: char | string

Output Arguments

expand all

Path of the created file, returned as a string scalar.

Data Types: string


expand all

This example shows how to copy the default PDF template for a state transition table reporter.

copiedFilePath = ...

The output of the command shows the path of the copied template file.

copiedFilePath = 


Version History

Introduced in R2022a