http://www.mathworks.com/matlabcentral/newsreader/view_thread/311539
MATLAB Central Newsreader  division of intervals
Feed for thread: division of intervals
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Fri, 12 Aug 2011 17:15:31 +0000
division of intervals
http://www.mathworks.com/matlabcentral/newsreader/view_thread/311539#848991
antonio ferreira
Hi all. <br>
I have a vector b=[0 1 3 5 6 7 8 10 10.5 13 14 15] that is composed by several points in x direction (the origin can be placed in b(1)) . Basically I need to find two fixed lengths that ensure that I have the same number of points in consecutive zones from b(1) to b(12). To illustrate this, for example, if I consider 2 lengths (leng1=3.5 and leng2=4) for this case I will like to have four vectores:<br>
zone1=[0 1 3 ] (from x=0 to x=3.5) (associated to leng1)<br>
zone2=[ 5 6 7] (from x=3.5 to x=7.5) (associated to leng2)<br>
zone3=[8 10 10.5] (from x=7.5 to x=11) (associated to leng1)<br>
zone4=[13 14 15] (from x=11 to x=15) (associated to leng2)<br>
In the case that i presented is very easy to define leng1 and leng2 but in my "real case" b is a much bigger matrix and it is inside a loop that`s why i need to consider an automatic way of finding leng1 and leng2. Can anybody give me a hint on this please?<br>
Regards.