Target Language Compiler    

Data Structure Sizes

The model.rtw file contains several fields that summarize the size of data structures required by a particular model. This information varies from model to model, depending on how many integrators are used, how many inputs and outputs are used, and whether states are continuous time or discrete time. In the case where continuous states exist within a model, you must use a solver, for example, ode5.

The model.rtw file provides additional information about the total number of work vector elements used for a particular model including RWork, IWork, PWork, and DWork (real, integer, pointer, and data type work vectors). The DWork vector field provides information for data type work vectors (to support types other than real_T). The model.rtw file also provides fields that contain summary information for all block signals, block parameters, and number of algebraic loops found throughout the model.

This table describes the sizes of data structures written to model.rtw.

Table A-5: Model.rtw Model Data Structure Sizes 
Variable/Record Name
Description
NumModelInputs

Sum of all root-level import block widths. This is the length of the external input vector, U.

NumModelOutputs

Sum of all root-level outport block widths. This is the length of the external output vector, Y.

NumNonVirtBlocksInModel

Total number of nonvirtual blocks in the model.

DirectFeedthrough

Does the model require its inputs in the MdlOutput function (yes/no)?

NumContStates

Total number of continuous states in the model. Continuous states appear in your model when you use continuous components (e.g., Integrator blocks) that have state(s) that must be integrated by a solver such as ode45.

NumModes

Length of the model mode vector (modeVect). The mode vector is used by blocks that need to keep track of how they are operating. For example, the discrete integrator configured with a reset port uses the mode vector to determine how to operate when an external reset occurs.

ZCFindingDisabled

Is zero-crossing event location (finding) disabled (yes/no)?
This is always
yes for fixed-step solvers.

NumNonsampledZCs

Length of the model nonsampled zero-crossing vectors. There are two vectors of this length: the zero-crossing signals (nonsampledZCs), and the zero-crossing directions (nonsampledZCdirs). Nonsampled zero-crossings are derived from continuous signals that have a discontinuity in their first derivative. Nonsampled zero-crossings only exist for variable step solvers. The Abs block is an example of a block that has an intrinsic, nonsampled zero-crossing to detect when its input crosses zero.

NumZCEvents

Length of the model zero-crossing event vector (zcEvents).

NumDWork

Total number of data type work vector elements. This is the sum of the widths of all data type work vectors in the model.

NumDataStoreElements

Total number of data store elements. This is the sum of the widths of all data store memory blocks in your model.

NumBlockSignals

Sum of the widths of all output ports of all nonvirtual blocks in the model. This is the length of the block I/O vector, blockIO.

NumBlockParams

Number of modifiable parameter elements (params). For example, the Gain block parameter contains modifiable parameter elements.

NumAlgebraicLoops

Number of algebraic loops in the model.


  Data Logging Information (DataLoggingOpts) Sample Time Information