In a For Iterator Subsystem, how to use the iteration variable ?
Mostrar comentarios más antiguos
Here is my problem : I set a 1-by-N array (A) in Matlab, then I run a simulation where I use a For Iterator Subsystem (i=iteration variable). This subsystem runs N times and I'd like to use i to call A(i) in other blocks (gain, constant, lk-tables, etc...)
I can't find a way to do this since the To Workspace Block doesn't make data available until the simulation is stopped or paused.
In other words, how can I use my iteration variable in real time and call A(i) in blocks during the simulation?
Thanks a lot in advance
2 comentarios
Kaustubha Govind
el 22 de Abr. de 2013
Editada: Kaustubha Govind
el 22 de Abr. de 2013
Are these other blocks also inside the For Iterator subsystem? If not, is there a reason they aren't? Because once they're inside the For Iterator subsystem, they are effectively getting A(i) as input.
Respuestas (1)
Guy Rouleau
el 22 de Abr. de 2013
0 votos
The iteration variable is a signal coming out of the For Iterator block.
Inside the subsystem, you can use a Selector block:
or Assignment block:
to read or write to elements of a vector or matrix A(i).
1 comentario
remi
el 23 de Abr. de 2013
Categorías
Más información sobre Subsystems en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!