The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: vectorization addtodate
Replies: 3   Last Post: Mar 30, 2013 10:11 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Watch Watch this User
vectorization addtodate
Posted: Mar 28, 2013 12:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi everyone.

Would it be possible to vectorize addtodate? I would like to add many different days to a given date. However, addtodate only accept 1 numeric scalar.

addtodate(datenum('1-jan-2000'), 1, 'day'); %add 1 day

But this won't work:

addtodate(datenum('1-jan-2000'), 1:10, 'day'); %add 1 day

It would be pretty easy to do with for loop, but I would like to avoid it if possible.

With regards,

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.