find time elapse in if statement

4 vues (au cours des 30 derniers jours)
H D
H D le 17 Déc 2014
Commenté : H D le 17 Déc 2014
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

Réponse acceptée

Roger Stafford
Roger Stafford le 17 Déc 2014
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 commentaire
H D
H D le 17 Déc 2014
great. thanks

Connectez-vous pour commenter.

Plus de réponses (1)

stalin
stalin le 17 Déc 2014
  1 commentaire
H D
H D le 17 Déc 2014
Thanks for looking at the question. The link is about whos function. Do you mean anything special?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Dates and Time dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by