User`s guide

13 Real-Time Workshop Rapid Simulation Target
13-12
From Workspace data must be contained in a structure variable with the
following fields:
var.time
var.signals.values
The field var.time must be of type double. The field var.signals.values can
be of any data type that Simulink supports. The length of
var.time must equal
the length of
var.signals.values.
By using the From Workspace block with
rsim, you can input new signal data
in any of the supported data types without the need to regenerate or recompile
your code.
You can also run a simulation using substitute signal data if each signal data
type is consistent with the signal data type at the time of code generation. For
example, if your model uses a signal contained in a MATLAB workspace
structure that is called
voice.signal.values
and this signal is of type int32, the replacement MAT-file data must also
contain a variable called
voice with the field voice.signals.values of type
int32. The variable must also contain the same number of channels (number of
signals). If desired, you can use time and signal data sets that are much larger
than the data used at the time of code generation. We recommend this for
simulations with very large sets of signal data, since it greatly reduces the
amount of unnecessary data that the Real-Time Workshop generates in the
.rtw file.
The
rsim target permits only one MAT-file which must contain all signal data.
If you do not intend to replace the original signal data, you can store the
original data in the default file,
from_workspace.mat.Inthiscase,youcanrun
the
rsim simulation without any arguments:
model
This has the same effect as running:
model -w from_workspace.mat
If you have specified data logging options prior to code generation, or, if you are
using To File or To Workspace blocks, data will be saved to the appropriate
MAT-file.