calculating elapsed and remaining time between times.

4 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by