Creating Countdown timer in Matlab App
Afficher commentaires plus anciens
Hi all,
I am trying to create a countdown timer in matlab. The user will press a button and that time will start to decrease. I have used an edit field text for the timer display. I am able to get the starting time displayed on the display, but am really struggling (i actually have no idea - even though I tried searching around) to determine how the 'countdown' works in Matlab. I have the following code:
properties (Access = private)
timerLeft = 0; % Description
end
and then:
function BeginButtonPushed(app, event)
end
function FunctionalityTest10sButtonPushed(app, event)
timerVal = 10;
app.timerLeft = timerVal;
app.timerCountdown.Value = '00:00:10';
end
All help is really appriciated.
Réponses (1)
Image Analyst
le 22 Avr 2022
0 votes
See attached demo. It's in GUIDE but you can click the link/button to convert it to App Designer.
5 commentaires
Kanwartej Singh
le 22 Avr 2022
Image Analyst
le 22 Avr 2022
Right click in your browser and them download those files to your local drive. Then open guide
>> guide
When guide opens up, open up gostop.fig.
At the bottom there will be a banner asking if you want to convert the code to App Designer. Click that.
Kanwartej Singh
le 23 Avr 2022
Examples:
dt = datestr(now, "HH:mm:ss")
t = datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss Z')
t1 = datetime(2022,4,23,9,034,06, 'Format','HH:mm:ss')
Kanwartej Singh
le 24 Avr 2022
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!