Rebuild generated code from model
rtwrebuild() assumes that the current working folder is
the build folder of the model (not the model location) and invokes the makefile
in the build folder. If the current working folder is not the build folder, the
function exits with an error.
rtwrebuild invokes the makefile generated during the
previous build to recompile files you modified since that build. Operation of
this function depends on the current working folder, not the current loaded
model. If your model includes referenced models,
invokes the makefile for referenced model code recursively before recompiling
the top model.
Computing Toolbox™ commands, for example, a
loop, do not invoke
slbuild commands that build models that are configured for parallel
builds. For information about parallel builds of referenced models, see Reduce Build Time for Referenced Models by Using Parallel Builds.
Invoke the makefile and recompile code when the current working folder is the build folder. For example,
If the model name is
And, if the model build was initiated in the
And, if the system target is GRT
Invoke the previously generated makefile in the current
working folder (build folder)
When the current working folder is one level above the build folder, invoke the makefile and recompile code.
Invoke the makefile and recompile code from a current folder
by specifying a path to the model build folder,
model— Model object or name for which to regenerate code or rebuild an executable image
Model for which to regenerate code or rebuild an executable image, specified as an object or a character vector representing the model name.
path— Model path object or fully qualified path to the build folder for the model for which to regenerate code or rebuild an executable image