generate an Array of numbers with specified spacing in a given range - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Low-level Manipulation : Matrices, Vectors, and Arrays : ArrayTools : ArrayTools/RegularArray

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

withArrayTools&colon;

RegularArray1..10&comma;&delta;&equals;10

1.

(1)

RegularArray1..100

1 .. 100 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(2)

RegularArray1..100&comma;3

1.50.50000000100.0000000

(3)

RegularArray1..5&comma;spacing&equals;log

1 .. 100 ArrayData Type: anythingStorage: rectangularOrder: Fortran_order

(4)

RegularArray1..5&comma;5&comma;spacing&equals;log

10.100.1000.10000.1.00000105

(5)

RegularArray1..&pi;&comma;3&comma;spacing&equals;log

10.5.6049912173.141592654

(6)

See Also

ArrayTools, ArrayTools[RandomArray], , ArrayTools[Size], rtable_indexing


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam