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

조회 수: 4 (최근 30일)
Agostino Piazzi
Agostino Piazzi 2020년 3월 20일
답변: Yash 2025년 7월 20일
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