Time difference between two sets of times in hrs mins and seconds.. GUI if possible
Mostrar comentarios más antiguos
Hi im new to MATLAB and trying to setup a GUI to calculate the time difference between two sets of times. Eg: 10:00:00 and 11:01:00
Difference would be 1 hr 1min and 0 seconds..
thanks in advance
Respuesta aceptada
Más respuestas (2)
Sean de Wolski
el 19 de Oct. de 2011
So start by opening GUIDE
guide %at the command line
Then draw the GUI so that it has edit boxes to enter times, static boxes to give directions, and a push button to press to give you the times. After that, write the functions to do the work. Or write the functions to do the work first and then add them to a GUI. Ask specific detailed MATLAB questions here when you get stuck.
Welcome to MATLAB Answers!
1 comentario
Sharon
el 19 de Oct. de 2011
Real User
el 20 de En. de 2023
>> duration("11:01:00")-duration("10:00:00")
ans =
duration
01:01:00
>> string(duration("11:01:00")-duration("10:00:00"))
ans =
"01:01:00"
>> [h, m, s]=hms(duration("11:01:00")-duration("10:00:00"))
h =
1
m =
1
s =
0
>> d = duration(h,m,s)
d =
duration
01:01:00
These work even if you include the dates.
[m,d,t] = split(T,{'months','days','time'})
Categorías
Más información sobre MATLAB en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!