Wrong sized array from "To workspace"
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 16 Juil 2023
If you have any kind off conditional execution, then different branches might have executed a different number of times.
Paul
le 17 Juil 2023
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
le 18 Juil 2023
Réponse acceptée
Plus de réponses (1)
Ali Hussein Numan
le 16 Juil 2025
0 votes
Use fixed step solver instead of variable step solver. The data to workspace will be with the same lengnth
Catégories
En savoir plus sur Programmatic Model Editing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!