function [p,delta] = partition(integerN, a, b)
## Partition the interval [a,b] into integerN subintervals. We do not
- ## requite that a<b.
+ ## require that a<b.
##
## INPUTS:
##
- ## * integerN - The number of subintervals.
+ ## * ``integerN`` - The number of subintervals.
##
- ## * a - The "left" endpoint of the interval to partition.
+ ## * ``a`` - The "left" endpoint of the interval to partition.
##
- ## * b - The "right" endpoint of the interval to partition.
+ ## * ``b`` - The "right" endpoint of the interval to partition.
##
##
## OUTPUTS:
##
- ## * p - The resulting partition, as a vector of length integerN+1.
+ ## * ``p`` - The resulting partition, as a vector of length integerN+1.
##
- ## * delta - The distance between x_i and x_{i+1} in the partition.
+ ## * ``delta`` - The distance between x_i and x_{i+1} in the partition.
##
##
## towards `b`.
delta = (b - a)/integerN;
- p = [a : delta : b];
+ p = partition_delta(a,b,delta);
end
--- /dev/null
+function [p] = partition_delta(a, b, delta)
+ ## Partition the interval [a,b] into subintervals of length delta. We
+ ## do not require that a<b.
+ ##
+ ## INPUTS:
+ ##
+ ## * ``a`` - The "left" endpoint of the interval to partition.
+ ##
+ ## * ``b`` - The "right" endpoint of the interval to partition.
+ ##
+ ## * ``delta`` - The length of the subintervals.
+ ##
+ ## OUTPUTS:
+ ##
+ ## * ``p`` - The resulting partition, as a vector of length (b-a)/delta.
+ ##
+
+ p = [a : delta : b];
+end