Wrong sized array from "To workspace"
显示 更早的评论
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 个评论
Walter Roberson
2023-7-16
If you have any kind off conditional execution, then different branches might have executed a different number of times.
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).
Anne
2023-7-18
采纳的回答
更多回答(1 个)
Ali Hussein Numan
2025-7-16
0 个投票
Use fixed step solver instead of variable step solver. The data to workspace will be with the same lengnth
类别
在 帮助中心 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!