how can create Changing lamp color with start and stop button
5 ビュー (過去 30 日間)
表示 古いコメント
採用された回答
Geoff Hayes
2022 年 4 月 21 日
@Amir Azadeh Ranjbar - you would need callback functions for your start and stop buttons. These callbacks would then change the colour of the lamp. Something like the following may work:
% Button pushed function: StartButton
function StartButtonPushed(app, event)
app.Lamp.Color = 'b'; % blue
end
% Button pushed function: StopButton
function StopButtonPushed(app, event)
app.Lamp.Color = 'r'; % red
end
その他の回答 (1 件)
参考
カテゴリ
Find more on Interactive Control and Callbacks 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!