Recurse into logged Simulation Output Simulink

This function retrieves the timeseries data of the logged Data recursively, it will also recurse into Buses.
1 Download
Updated 6 Mar 2024

View License

Logging Data in Simulink is easy, but when using buses it can be hard to access the Data in the Matlab Workspace. Therefore this function recurses into the logsout data object and will extract the Values Data and Time.
function [varargout] = recurseIntoLogsout(SC,varargin)
% This function recurses into the Simulink.SimulationData.Dataset object.
%
% [names] = recurseIntoLogsout(out.logsout) will display all logged Signal Names,
% but will not recurse into Bus Struct. Empty Cell means signal is not
% being propagated in model or has not been given a name.
%
% [data,time] = recurseIntoLogsout(out.logsout, SignalName) will extract
% timeseries Data and Time Values for signal "SignalName".
% Function will automatically recurse into Buses that are being logged.
%
% [data,time] = recurseIntoLogsout(BusStruct, SignalName,1) will recurse
% into Bus Struct and extract timeseries Data and Time Values for signal "SignalName"
%
% INFO: data = NaN or time = NaN means the specified Signal could not be found.

Cite As

Christian Luciano Maendle (2024). Recurse into logged Simulation Output Simulink (https://www.mathworks.com/matlabcentral/fileexchange/160671-recurse-into-logged-simulation-output-simulink), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0