Main Content

rtwrebuild

Rebuild generated code from model

Description

example

rtwrebuild() assumes that the current working folder is the build folder of the model (not the model location) and calls codebuild. If the current working folder is not the build folder, the function exits with an error.

rtwrebuild calls codebuild 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, codebuild recompiles code for all models in the hierarchy.

In Parallel Computing Toolbox™ commands, for example, a parfor or spmd loop, do not invoke rtwbuild, rtwrebuild, or 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.

example

rtwrebuild(model) assumes that the current working folder is one level above the build folder and calls codebuild. If the current working folder (pwd) is not one level above the build folder, the function exits with an error.

example

rtwrebuild(path) finds the build folder indicated with the path argument. The path argument syntax lets the function operate without regard to the relationship between the current working folder and the build folder of the model.

Examples

collapse all

Call codebuild and recompile code when the current working folder is the build folder. For example,

  • If the model name is mymodel

  • And, if the model build was initiated in the C:\work folder

  • And, if the system target is GRT

rtwrebuild()

When the current working folder is one level above the build folder, call codebuild to recompile code.

rtwrebuild('mymodel')

Recompile code from a current folder by specifying a path to the model build folder, C:\work\mymodel_grt_rtw.

rtwrebuild(fullfile('C:','work','mymodel_grt_rtw'))

Input Arguments

collapse all

Model for which to regenerate code or rebuild an executable image, specified as an object or a character vector representing the model name.

Example: 'CounterModel'

Example: fullfile('C:','work','mymodel_grt_rtw')

Version History

Introduced in R2009a