1 function [p,delta] = partition(integerN, a, b)
2 ## Partition the interval [a,b] into integerN subintervals. We do not
7 ## * ``integerN`` - The number of subintervals.
9 ## * ``a`` - The "left" endpoint of the interval to partition.
11 ## * ``b`` - The "right" endpoint of the interval to partition.
16 ## * ``p`` - The resulting partition, as a vector of length integerN+1.
18 ## * ``delta`` - The distance between x_i and x_{i+1} in the partition.
22 ## We don't use abs() here because `b` might be less than `a`. In that
23 ## case, we want delta negative so that when we add it to `a`, we move
25 delta = (b - a)/integerN;