calculating elapsed and remaining time between times.

조회 수: 1 (최근 30일)
siki
siki 2016년 12월 6일
편집: siki 2016년 12월 6일
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에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by