how can create Changing lamp color with start and stop button
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/972210/image.png)
0 个评论
采纳的回答
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!