]> gitweb.michael.orlitzky.com - octave.git/blob - partition_delta.m
febb4dc898cc336363d19ebe3f85faddd5766949
[octave.git] / partition_delta.m
1 function [p] = partition_delta(a, b, delta)
2 ## Partition the interval [a,b] into subintervals of length delta. We
3 ## do not require that a<b.
4 ##
5 ## INPUTS:
6 ##
7 ## * ``a`` - The "left" endpoint of the interval to partition.
8 ##
9 ## * ``b`` - The "right" endpoint of the interval to partition.
10 ##
11 ## * ``delta`` - The length of the subintervals.
12 ##
13 ## OUTPUTS:
14 ##
15 ## * ``p`` - The resulting partition, as a vector of length (b-a)/delta.
16 ##
17
18 p = [a : delta : b];
19 end