How to get Pushed Button activity

2 ビュー (過去 30 日間)
Mustafa Sereflioglu
Mustafa Sereflioglu 2020 年 7 月 15 日
回答済み: Sahithi Kanumarlapudi 2020 年 7 月 21 日
Hello People,
i have two buttons: One is called: PressButtontostartForloop
And the other one is called: ActivityButton
if i Press the Button : PressButtontostartForloop the compiler goes right into the function below...
I want to manipulate the function below, by pushing the ActivityButton from the GUI.
I'm new in Matlab App designer and dont know how to handle this problem.
function PressButtontostartForloopValueChanged(app, event)
for Counter=1 : 10000000
if ActivityButton.Value ==1 %<-- This Line
%Do Something
end
end
end
I read something about callback functions. But i dont know how to do it..
Best regards,
MS

回答 (1 件)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2020 年 7 月 21 日
Hi,
From your question it looks like you would like to manipulate the callback function of one button based on the other button's activity. You would not need two buttons inorder to perform that. You could have one button in the app and use the callback of this button to manipulate the data.
Below code might serve as an example
ActivityButton = uibutton(fig,'push',...
'ButtonPushedFcn', @(btn,event) ActivityButtonPushed(btn,ax));
Perform all your calculations in the function defnition of ActivityButtonPushed
For more information refer to the following link

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by