Add custom code and imported artifacts to MATLAB project
success = obj.addToProject(
obj is an object of class
sltest.CodeImporter, adds the specified custom C/C++ code and the artifacts
generated when importing custom code (using the
import method) to an
existing MATLAB® project. Generated artifacts include a Simulink® library and a data dictionary, and for objects of class
sltest.CodeImporter, a sandbox folder. If you choose to generate a test
harness and test files for the imported blocks, generated artifacts also include Simulink
Test™ files (Simulink
Test license required).
addToProject only after a successful import of custom
ProjectFilePath — Name of existing MATLAB project
character vector | string scalar
Name of existing MATLAB project, specified as a character vector or string scalar. The path can be
a full path or a path relative to the current MATLAB folder. For
addToProject to be successful, all custom
code files and the Simulink library and other generated artifacts must be located in either the same
folder as the MATLAB project or in direct or indirect subfolders of that folder.
character vector |
success — Success indicator
Success indicator of whether code and artifacts are added to project, returned as a logical scalar. If not successful, Simulink throws an error.