How to fill a matrix in a timeseries with one single time step?

조회 수: 3 (최근 30일)
Simulant
Simulant 2021년 8월 11일
댓글: Simulant 2021년 8월 16일
Hello,
I want to fill a 2x3 matrix in a timeseries for simulating in simulink with one single time step. It works if I have more than one time step: The series.Data gets the size 2x3x[NumberOfTimesteps].
But when I only have one time step it does not work to use the reshape command because a 2x3x1 matrix results to a 2x3 matrix. Then simulink interpretates the matrix as a 1x3 array.
Is there any solution? I think it would work, if I could force a 2x3 matrix to a 2x3x1 matrix.
Edit: I want to use the timeseries to load the data in the 'FromWorkspace' Block.
  댓글 수: 4
Walter Roberson
Walter Roberson 2021년 8월 11일
It is not possible to create a 2 x 3 x 1 array that can be detected as being different than a 2 x 3 array with the same elements.
Simulant
Simulant 2021년 8월 16일
Thanks for helping me! :-)
I found a simple solution to avoid the problem:
I added a dummy step to my simulation after the first step, to get the simulation running. From the simulation result I remove the last dummy step.
But still it would be nice, if Matlab could see a difference between a [x, y] and a [x, y, 1] matrix.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by