Can't read timeseries generated with "to file" in Simulink

5 次查看(过去 30 天)
hi, im developing a simple model with simulink. the model uses the "matlab function block" and other simple blocks.
i m trying to write the output of my model into a timeseries using the "to file" block .
everithing runs fine but when i try to open the timeseries in matlab i only get the visualization of the properties of the timeseries, for example:
timeseries
Common Properties:
Name: ''
Time: [11x1 double]
TimeInfo: tsdata.timemetadata
Data: [1x1x11 double]
DataInfo: tsdata.datametadata
and i cannot see the table with the data and the time intervals. (i can only get acess to the data by using, for example the command "getdatasamples") but, again, i cannot see the whole table
i tried to run the examples provided by mathworks of the timeseries and on the "to file" block and they work.
does anyone have any suggestion? thanks

回答(1 个)

Yash
Yash 2025-7-20
The simulation output data is present in "Data" property in the MAT file saved by the "To File" block. In your case the data is stored as a 1x1x11 3d double array. You can use MATLAB function "squeeze" to remove dimensions of length 1 to better visualize the data.
Alternatively, you can use "To Workspace" block in place of "To File" block as well.

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by