Basic Slider Switch question
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Matthew Mishrikey
el 20 de Dic. de 2021
Editada: Matthew Mishrikey
el 9 de Feb. de 2022
I was curious if it was possible to make a slider switch dashboard element control more than one block simultaneously. Alternately, can I use a switch to somehow set a global parameter that the whole sim can access?
0 comentarios
Respuesta aceptada
Benjamin Thompson
el 8 de Feb. de 2022
Looks like you can only connect the Slider Switch to one block. But if that was a Constant block connected to a Data Store Write, then you could put Data Store Reads throughout your model and in that way redistribute your parameter change to more points.
4 comentarios
Benjamin Thompson
el 8 de Feb. de 2022
You can also use set_param to change parameters on blocks. If you go to Model Properties you can add M-code to be called at certain times, like during model init or simulation start. Perhaps there, you could read your data value from the workspace or something like that, then use it to set block parameters in different places in the model. This would not change when you move your slides as you originally wanted.
If you can put all blocks that depend on the slider in a masked subsystem, then your slider could just change a parameter in the mask. Then through the parameter promotion mechanism you can assign block parameters within the mask to one parameter that is set by the user in the mask.
Más respuestas (2)
Matthew Mishrikey
el 9 de Feb. de 2022
Editada: Matthew Mishrikey
el 9 de Feb. de 2022
0 comentarios
Ver también
Categorías
Más información sobre Composite Components 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!