calculating elapsed and remaining time between times.
Afficher commentaires plus anciens
t1={'2011-10-01 11:12:00'}; \\ initial value of loop
t2={'2012-03-31 23:09:00'}; \\ end value of loop
t11=datenum(t1(:));
t22=datenum(t2(:));
intrvl=datenum(0,0,0,0,1,0); \\ loop interval in minutes.
ff=datenum(starttime(:)); \\ startime: <78678x1 cell> in {2016-12-06 5:51:10} format
gg=datenum(stoptime(:)); \\ stoptime: <78678x1 cell> in {2016-12-06 5:51:10} format
for t=t11:intrvl:t22;
if(t > ff(loop-for-starttime) && t < gg(loop-for-stoptime))
body
end
end
My task is to check each value of loop ( starting from 2001-10-01 11:12:00 to 2012-03-31 23:09:00) if it is greater than starttime and less than stoptime and store searched values in a variable. if a condition is accepted it should calculate estimated time and remaining time for each searched values.
estimated time = etime(starttime,t)
remaining time= etime(stoptime,t)
kindly help.
Réponses (0)
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!