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: Uneven grid points?
Replies: 2   Last Post: Oct 8, 2012 7:13 AM

Advanced Search

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

Posts: 412
Registered: 12/7/04
Re: Uneven grid points?
Posted: Oct 8, 2012 6:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Shashank " <shashank312@yahoo.co.uk> wrote in message <k4tv8b$kbp$1@newscl01ah.mathworks.com>...
> How to create a variable (using linspace) for the following configuration:
>
> Distance between the first and second point = 0.5h
> Distance between the second and third point = h
> Distance between the third and fourth point = h
> And so on...
> Distance between the (N-2)th and (N-1)th point = h
> Distance between the (N-1)th and Nth point = 0.5h
>
> A quick retort would be appreciated.
>

X = cumsum([0,0.5,ones(1,nX-3), 0.5])*h;

HTH



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.