Get value from simulink model to matlab gui while simulink is running
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mitesh Farsodia
am 19 Aug. 2011
Beantwortet: ian barahona
am 1 Jun. 2020
With respect to following post I have some doubts related to command get_param:
1) When I use this command it returns me empty vector. 2) Can we use this command for any block like display, demux and out or it has to be Gain block only?
Thanks Mitesh
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 19 Aug. 2011
I believe it can be done that way and it should apply to all types of blocks. Remember you can't just use get_param() alone, you need to set up the event listener and callback function. See Guy Rouleau's anser in this post. It points to the link from the Mathworks website.
15 Kommentare
Fangjun Jiang
am 24 Aug. 2011
My understanding is, whenever the event happened, the pre-defined callback function will be executed.
Weitere Antworten (3)
Paulo Silva
am 19 Aug. 2011
- When you use get_param where? what block and what code?
- That command can only get the parameters supported by the block you are using as argument.
5 Kommentare
Kristof
am 13 Apr. 2014
You first have to start simulation, and right after that you can add eventlisteners.
Arunkumar Muthukumaran
am 17 Dez. 2015
Another solution would be to use a Matlab function in your model to update the GUI handle in each timestep. Pass the value from model which needs to be displayed in GUI and update GUI handle respectively.
0 Kommentare
ian barahona
am 1 Jun. 2020
Another posible solution is using another block instead of a "Gain" block. i used a "Product" and worked like it was a "Gain" block. rto = get_param('lm35_sim/Product','RuntimeObject');
0 Kommentare
Siehe auch
Kategorien
Mehr zu Schedule Model Components finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!