Converting simulink blocks to code for a GUI?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to create a GUI in MATLAB that has two sliders that can be used to adjust the value a and b. I know I can get the GUI to open simulink and have simulink do this and then packet the information using UDP as shown in the following image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147779/image.png)
However, I would prefer to be able to convert these simulink blocks to code in the GUI slider. More specifically, I am interested in coding the packet output block so the GUI button can send the information. Does anyone know how to do this?
0 Commenti
Risposte (2)
cr
il 14 Mag 2013
You can use set command for callbacks of GUI sliders with handles of the constant blocks to change the block parameter values. Not sure what the packet output block is, but if you are able to "send the information" from simulink, then the same can be done via GUI too using handle to the block. For more info, see gcs, gcb, set & get. You may want to read the section on programmatically using simulink models in documentation.
1 Commento
Kaustubha Govind
il 20 Mag 2013
Since you'd like to execute the GUI as if it were a block, it might be best to create a custom block that opens up and reads from a GUI during simulation, and computes its outputs based on actions on the GUI. Please look into MATAB S-functions.
Vedere anche
Categorie
Scopri di più su Simulink Functions in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!