ArrayTools[RegularArray] - generate an Array of numbers with specified spacing in a given range
|
Calling Sequence
|
|
RegularArray(a..b, delta = d);
RegularArray(a..b);
RegularArray(a..b, n);
RegularArray(a..b, spacing = type);
RegularArray(a..b, n, spacing = type);
|
|
Parameters
|
|
a..b
|
-
|
the range of the numbers
|
delta = d
|
-
|
(optional) the spacing of the numbers generated; default spacing is linear
|
n
|
-
|
(optional) the number of points generated; default number of points is 100
|
spacing = type
|
-
|
(optional) the type of spacing, where type is one of log or linear; default spacing is linear
|
|
|
|
|
Description
|
|
•
|
The RegularArray(a..b, delta = d) function returns numbers a, a + d, a + 2d, ..., where the last number is less or equal to b. If d = 0, or m < 0 and a < b, or m > 0 and a > b, then it returns an empty Array.
|
•
|
The RegularArray(a..b) and RegularArray(a..b, spacing = linear) functions return 100 numbers, evenly spaced between a and b, including a and b.
|
•
|
The RegularArray(a..b, n) and RegularArray(a..b, n, spacing = linear) functions return n numbers, evenly spaced between a and b, including a and b. Both functions return b if n < 2.
|
•
|
The RegularArray(a..b, spacing = log) function returns 100 numbers, logarithmically spaced between 10^a and 10^b, including 10^a and 10^b.
|
•
|
The RegularArray(a..b, n, spacing = log) function returns n numbers, logarithmically spaced between 10^a and 10^b, including 10^a and 10^b. It returns 10^b if n < 2. If b = Pi or evalhf(Pi), the function returns numbers between 10^a and evalf(Pi), including 10^a and evalf(Pi).
|
•
|
This function is part of the ArrayTools package, so it can be used in the short form RegularArray(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[RegularArray](..).
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
|
|