Get current unit system configured in Simulation Data Inspector preferences
Configure Unit Preferences in the Simulation Data Inspector
To specify a system of units to use for plotting signals in the Simulation Data Inspector, use the
Simulink.sdi.setUnitSystem function. When you choose to display signals using the
US Customary unit system, the Simulation Data Inspector automatically changes the Display Units property for logged or imported signals that use units that are not part of the specified unit system. The signal data stored on disk does not change. Signals also have a Stored Units property, and the Simulation Data Inspector converts the data to plot the signal when the Stored Units and Display Units differ.
Specify a Sytem of Units
By default, the Simulation Data Inspector displays signals using the units assigned to the signal during simulation or in the imported data. To facilitate analyzing multiple signals and data sets together, you can specify a system of units as a preference. The Simulation Data Inspector automatically updates the Display Units for logged or imported signals that use units that are invalid in the specified unit system. For example, a signal logged in a model using units of
ft could be updated to use units of
m when the system of units is specified as
Simulink.sdi.setUnitSystem function to configure the Simulation Data Inspector to display signals using units in the US Customary unit system.
Specify Override Units
When you want all signals that represent the same type of measurement to use the same Display Units, you can also specify override units. For example, to plot all signals that represent length using units of
ft as an override unit.
Check Unit Configuration
Simulink.sdi.getUnitSystem function to check the current unit preferences configured in the Simulation Data Inspector.
[unitSystem,overrideUnits] = Simulink.sdi.getUnitSystem
unitSystem = 'USCustomary'
overrideUnits = "ft"
unitSystem — System of units used to define signal display units
System of units used to define signal display units, returned as a character vector.
overrideUnits — Units to override signal display units
string | string array
Units to override signal display units, returned as a string or string array. The
Simulation Data Inspector displays all signals that represent a measurement type using
specified override units. For example, if override units of
specified, the Simulation Data Inspector displays all signals that represent length
using units of
Introduced in R2020b