find time elapse in if statement

조회 수: 6 (최근 30일)
H D
H D 2014년 12월 17일
댓글: H D 2014년 12월 17일
Hi I have a matlab serial date number as this t1= 7.316213854513889e+005 New times will arrive and I need to check if the difference of t1 and the next is greater than 10 minutes. If true {do something} else {do another task}
How to compare two matlab serial date number against particular minutes or seconds
regards

채택된 답변

Roger Stafford
Roger Stafford 2014년 12월 17일
According to the documentation for 'datenum' at:
http://www.mathworks.com/help/matlab/ref/datenum.html
"A serial date number represents the whole and fractional number of days from a fixed, preset date (January 0, 0000)." Hence ten minutes would be this fraction of a day:
10/60/24 = .006944444....
so if your next serial date number differs from t1 by more than that amount, you should "do something".

추가 답변 (1개)

stalin
stalin 2014년 12월 17일
  댓글 수: 1
H D
H D 2014년 12월 17일
Thanks for looking at the question. The link is about whos function. Do you mean anything special?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by