Wrong sized array from "To workspace"
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Anne
el 16 de Jul. de 2023
Respondida: Ali Hussein Numan
el 16 de Jul. de 2025
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 comentarios
Paul
el 17 de Jul. de 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).
Respuesta aceptada
Sulaymon Eshkabilov
el 17 de Jul. de 2023
Are you using a variable step solver in your model? If so, you'd need to change it to a fixed step solver.
3 comentarios
Más respuestas (1)
Ali Hussein Numan
el 16 de Jul. de 2025
Use fixed step solver instead of variable step solver. The data to workspace will be with the same lengnth
0 comentarios
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!