Passing value of a variable From GUI button to Simulink model while running the simulation
Show older comments
Sir/ Ma'am
I want to create a GUI in matlab which can send on/ off status to a simulink model. The model will take this passed on/off value as a input to one of the block. Actually, its like i dont want to use manual switch in model instead i want same function using GUI button callback.
Can anyone provide any help on this topic? Its urgent.
Accepted Answer
More Answers (1)
Paulo Silva
on 24 Feb 2011
%pushbutton 1 callback
set_param(gcs,'SimulationCommand','start')
%pushbutton 2 callback
set_param(gcs,'SimulationCommand','stop')
%get the status of the system
get_param(gcs, 'SimulationStatus')
I recommend to replace gcs with your system name ('mysystem')
More info can be found in your matlab documentation
1 Comment
HITESH TRIVEDI
on 7 Mar 2011
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!