Variable-size matrix in Simulink
Mostrar comentarios más antiguos
Hello everybody !
I have a question about variable size matrix in Simulink. Indeed, I would like to generate a matrix in Simulink (sized [1xN] or [MxN]), with M and N the dimensions of the matrix calculated in Simulink using Workspace variables.
However, Simulink does not understand this type of signal to be generated during the simulation, and must automatically refer to Workspace variables.
One solution I used to overcome this problem was to create a [1000x1000]-sized matrix of zeros, and assign the values I wanted in this matrix. I would then simply resize this matrix to a matrix of dimension MxN.
However, I have the same problem as before, even when trying different matrix resizing algorithms, because I need either M or N dimensions at a specific point.
Do you have any suggestions on how to do this ? Is it possible to get around this problem in an elegant way, or is it impossible on Simulink ?
Thanks in advance for your suggestions and answers ! Have a nice day ! :)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Array and Matrix Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!