calculating elapsed and remaining time between times.
4 views (last 30 days)
Show older comments
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.
0 Comments
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!