Converting simulink blocks to code for a GUI?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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:

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 Kommentare
Antworten (2)
cr
am 14 Mai 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 Kommentar
Kaustubha Govind
am 20 Mai 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.
Siehe auch
Kategorien
Mehr zu Event Functions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
