I understand how to divide a given interval in 'N' equal subintervals.
min_range=a;
max_range=b;
intervalcount=N;
x = (b-a)/N;
y=min_range:x:max_range
But how do I get 'N' intervals of varying length. I found a related post How to divide time interval into parts of varying length? but this solution is for the case of repetitive sequence of interval length.
I am looking for a solution that returns best 'N' partitions of increasing length for a given range ie length(interval_x) < length(interval_(x+1)) . The resulting subintervals will be chirp -like
Your requirement that each interval has to be larger than the last makes it a little open-ended, since there are a number of different ways to satisfy that constraint. One option is to make each interval be a fixed increment larger than the last (ie interval one is width w
, interval two is width 2*w
, etc.). Here's an easy way to accomplish this is with cumsum
:
v = cumsum(0:N);
y = a+(b-a).*v./v(end);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.