Does it exist a function which is similar to time() function of C ambient ?

2 visualizzazioni (ultimi 30 giorni)
Hi, i'm working with random number generation, I would like to know if exists, in Matlab, a function like time(0) of C ambient (like emacs) which gives the number of seconds from a certain day.

Risposta accettata

Jan
Jan il 11 Ott 2017
Modificato: Jan il 11 Ott 2017
The number of seconds of the current day:
s = rem(now, 1) * 86400;
Number of seconds since 17-Mar-2011:
s = (now - datenum('17-Mar-2011')) * 86400;
This does not use the modern datetime object.

Più risposte (1)

Categorie

Scopri di più su Random Number Generation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by