Hi, how can I get the first row elapsed time as zero please, for eg, if I have a 42x6 date vector column, I get only 41 x 1 column of time differences.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Aswas
am 26 Sep. 2015
Kommentiert: Star Strider
am 27 Sep. 2015
My code : e = etime(t2, t1)
0 Kommentare
Akzeptierte Antwort
Star Strider
am 26 Sep. 2015
Bearbeitet: Star Strider
am 26 Sep. 2015
The etime function subtracts two date vectors, producing a single value (elapsed time in seconds). To get 0 as the first entry in the output, either duplicate the first entry in your date vector array, or simply concatenate a zero onto it:
e = [0; etime(t2, t1)]
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!