Wrong sized array from "To workspace"
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello!
I am interested in using several arrays in a Matlab code. Thus, I used the "to workspace" block to convert signal values to arrays. I used the settings:

However, for some reason, I got two arrays with different dimensions:
What should I do to have correctly sized arrays?
댓글 수: 3
Paul
2023년 7월 17일
I think that, unless the To Workspace block is actually inside a conditionally executed subsystem, the only thing that matters is the sample time of the signal input to the To Workspace block, becasue the Sample time paramater of the To Workspace block is set to -1 (inherited).
채택된 답변
Sulaymon Eshkabilov
2023년 7월 17일
Are you using a variable step solver in your model? If so, you'd need to change it to a fixed step solver.
댓글 수: 3
추가 답변 (1개)
Ali Hussein Numan
2025년 7월 16일
Use fixed step solver instead of variable step solver. The data to workspace will be with the same lengnth
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!