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 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, rtwrebuild invokes the makefile for referenced model code recursively before recompiling the top model.

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 invokes the makefile in the build folder. 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 and invokes the makefile in the build folder. 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

Invoke the makefile 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

Invoke the previously generated makefile in the current working folder (build folder) C:\work\mymodel_grt_rtw.

rtwrebuild()

When the current working folder is one level above the build folder, invoke the makefile and recompile code.

rtwrebuild('mymodel')

Invoke the makefile and 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: 'rtwdemo_exporting_functions'

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

See Also

|

Topics

Introduced in R2009a