Effacer les filtres
Effacer les filtres

How to get Pushed Button activity

1 vue (au cours des 30 derniers jours)
Mustafa Sereflioglu
Mustafa Sereflioglu le 15 Juil 2020
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

Réponses (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi le 21 Juil 2020
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

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by