Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Guest

Watch Watch this User
Re: vectorization addtodate
Posted: Mar 29, 2013 12:08 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Thursday, March 28, 2013 12:01:04 PM UTC-4, pmassicotte wrote:
> 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,
>
> Phil


Thank you for these clear explainations.

Regards,
Phil



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.