Skip to Main Content Skip to Search
Product Documentation

RTW.getBuildDir - Build folder information for specified model

Syntax

struct=RTW.getBuildDir(modelName)

Input Arguments

modelName

String specifying the name of a Simulink model, which can be open or closed.

Output Arguments

Structure containing the following build folder information about the specified model:

FieldDescription
BuildDirectoryString specifying the fully qualified path to the build folder for the model.
RelativeBuildDirString specifying the build folder relative to the current working folder (pwd).
BuildDirSuffixString specifying the suffix appended to the model name to create the build folder.
ModelRefRelativeBuildDirString specifying the model reference target build folder relative to current working folder (pwd).
ModelRefRelativeSimDirString specifying the model reference target simulation folder relative to current working folder (pwd).
ModelRefDirSuffixString specifying the suffix appended to the system target file name to create the model reference build folder.

Description

The RTW.getBuildDir function returns build folder information for a specified model, which can be open or closed. If the model is closed, the function opens and then closes the model, leaving it in its original state.

This function can be used in automated scripts to programmatically determine the build folder in which the generated code for a model would be placed if the model were built in its current state.

Examples

Return build folder information for the model mymmodel.

>> info=RTW.getBuildDir('mymodel');
>> info

info = 

              BuildDirectory: 'c:\work\mymodel_ert_rtw'
            RelativeBuildDir: 'mymodel_ert_rtw'
              BuildDirSuffix: '_ert_rtw'
    ModelRefRelativeBuildDir: 'slprj\ert\mymodel'
      ModelRefRelativeSimDir: 'slprj\sim\mymodel'
           ModelRefDirSuffix: ''
  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS