Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Bjorn Gustavsson Posts: 430 Registered: 12/7/04
Re: Uneven grid points?
Posted: Oct 8, 2012 6:55 AM

"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

Date Subject Author
10/8/12 Shashank
10/8/12 Bjorn Gustavsson
10/8/12 Bruno Luong