image thumbnail


version (1.79 KB) by Mike Anthony
Outputs a matrix of doubles containing the data from signals logged in Simulink.


Updated 01 Sep 2016

View License

Mike Anthony
Mark McBroom
Copyright 2010 The MathWorks, Inc.
This is a recursive function takes any of the following data objects commonly associated with data logging in Simulink:
Simulink Timeseries

This function outputs an nxm matrix of type double where:
n = length of the timeseries data
m = number of timeseries in the input (if the input is a
Timeseries, m = 1).

output_matrix = CreateMatrixFromModelData(inputTsArray)

This function is particularly useful in conjunction with bus signals, signal logging, and the Limit Check element in SystemTest. When signal logging is enabled for a bus signal in Simulink, the data is saved as a Simulink.TsArray. As of R2009b, the Limit Check Element in SystemTest only supports native Simulink data types. The matrix output of this function is fully compatible with the Limit Check element. As such, this provides a quick way to compare bus signals in the limit check element.

This function works well along with the functions in the acknowledgments section.

Cite As

Mike Anthony (2022). CreateMatrixFromModelData (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
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!