Output
Description
Saves data for signals connected to root-level Outport blocks to the specified MATLAB® variable.
Category: Data Import/Export
Settings
Default: On, yout
On
Simulink® exports root outport signal data to the MATLAB workspace during simulation.
Specify the name of the MATLAB variable used to store the data. See Export Simulation Data for more information.
Off
Simulink does not export root outport signal data during simulation.
Tips
You must select the Output check box before entering a name for the output variable.
Simulink saves the output to the MATLAB workspace at the base sample rate of the model if you set the Format parameter to a value other than
Dataset
. ForDataset
format, logging uses the rate set for each Outport block.The Additional parameters area includes parameters for specifying other characteristics of the saved data, including the format and the decimation factor.
To specify an interval for logging, use the Logging intervals parameter.
To log Output data to the Simulation Data Inspector, select Dataset format.
To log fixed-point data, set the Format parameter to
Dataset
. If you set the Format parameter to a value other thanDataset
, Simulink logs fixed-point data as double.To log bus data, set the Format parameter to a value other than
Array
.If you use a format other than
Dataset
, you can convert the logged data toDataset
format. Converting the data toDataset
makes it easier to post-process with other logged data. For more information, see Dataset Conversion for Logged Data.For the active variant condition, Simulink creates a
Dataset
object with the logged data. For inactive variant conditions, Simulink creates MATLABtimeseries
with zero samples.When you call the
sim
function inside a function, the output logged by the function is in the function workspace. To access that output in the base workspace, add a command such as this after thesim
command:assignin('base','yout',yout);
Do not use a variable name that is the same as a
Simulink.SimulationOutput
object function name or property name.To log data for a variable-size signal connected to a root-level Outport block, use the
Dataset
format. Data for a variable-size signal is always saved as atimetable
object that contains a cell array of data for each time step.
Programmatic Use
Parameter:
SaveOutput |
Value:
'on' | 'off' |
Default:
'on' |
Parameter:
OutputSaveName |
Type: character vector |
Value: any valid value |
Default:
'yout' |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No recommendation |
Safety precaution | No recommendation |