Load Signal Data That Uses Units
Signal data logged in a previous simulation using signal logging or the To
File or To Workspace block can include units information for
Dataset
or Timeseries
logging formats.
When you add signals with unit information to the Playback block, the unit information is retained when those signals are loaded into the model during simulation. You can also the Units property in the Port editor to perform a unit conversion on the loaded data when the signal units and port units are compatible.
Data logged by a top-level Outport block in a previous simulation contains units information if:
These Data Import/Export configuration parameter settings:
Output is enabled.
Format is
Dataset
.
For the Outport blocks that you log, in the Block Parameters dialog box, you set the Unit parameter.
Otherwise, to include units in signal data that you load, for the Units
property of the MATLAB®
timeseries
objects that you want to load, specify a
Simulink.SimulationData.Unit
object.
Loading Buses That Have Units
When you input a bus to a root-level Inport or Outport block, or you use a From File or From Workspace block, the output data type of the block must be a bus object. When you load the data from these blocks, the units in loaded data must match the units specified for the bus elements in the bus object. If the units for the loaded data do not match the units for a bus element in the bus object, Simulink® uses the units specified in the bus object.