generateFiles
Generate MATLAB files for code generation using coder configurer
Description
generateFiles( generates the
MATLAB® files required to generate C/C++ code by using the coder configurer
configurer)configurer, and saves the generated files in the current
folder.
To customize the code generation workflow, use generateFiles and
codegen (MATLAB Coder). If you do not need to customize your
workflow, use generateCode.
generateFiles generates the following MATLAB files:
predict.m,update.m, andinitialize.m—predict.mandupdate.mare the entry-point functions for thepredictandupdatefunctions of the machine learning model, respectively, and these two functions callinitialize.m. You can modify these files according to your code generation workflow. For example, you can modify thepredict.mfile to include data preprocessing, or you can add these entry-point functions to another code generation project.A MAT file that includes machine learning model information —
generateFilesuses thesaveLearnerForCoderfunction to save machine learning model information in a MAT file whose file name is stored in theOutputFileNameproperty of a coder configurer.initialize.mloads the saved MAT file by using theloadLearnerForCoderfunction.
After you generate these files, generate C/C++ code by using codegen (MATLAB Coder) and the prepared codegen argument stored in the
CodeGenerationArguments property of a coder configurer.
If the folder already includes all four MATLAB files, then generateFiles does not generate any
files.
generateFiles(
generates the MATLAB files in the folder specified by configurer,'OutputPath',outputPath)outputPath.
Examples
Input Arguments
Alternative Functionality
To customize the code generation workflow, use
generateFilesandcodegen(MATLAB Coder). If you do not need to customize your workflow, usegenerateCode. In addition to generating the four MATLAB files generated bygenerateFiles, thegenerateCodefunction also generates the C/C++ code.
Version History
Introduced in R2018b