Creating a time vector

Silly question:
How do I create a time vector from scratch, say beginning in 1981 and ending in 2010?
Thanks

2 个评论

It depends on what a "time vector" is.
per isakson
per isakson 2013-7-8
编辑:per isakson 2013-7-8
Is your question related to Time Series Basics in Matlab?

请先登录,再进行评论。

 采纳的回答

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 个评论

Exactly. Thanks a bunch.
hi, and what if I want this time vector with 1 min interval.? how to make it possible?
If you add another number after the 1 or 31 it would be a minute vector, then you can just extract that.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File 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