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: 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: 430
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 " <> wrote in message <k4tv8b$kbp$>...
> 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;


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.