Creating a time vector
4 views (last 30 days)
Show older comments
Silly question:
How do I create a time vector from scratch, say beginning in 1981 and ending in 2010?
Thanks
Accepted Answer
Jan
on 8 Jul 2013
It depends on what a "time vector" is. Perhaps a datenum vector with a step size of days?
v = datenum(1981, 1, 1):datenum(2010, 11, 31);
A similar approach works for a stepsize of seconds or hours etc.
3 Comments
pruth
on 21 May 2018
hi, and what if I want this time vector with 1 min interval.? how to make it possible?
More Answers (0)
See Also
Categories
Find more on Time Series Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!