![]() |
| サイトマップ | |
|
関数 data
は、開始値から終了値までの数値範囲を指定した増分で生成します。
data
(start, stop, step)
いずれの引数もスカラーで指定します。引数 start には最初の数値を、引数 stop には最後の数値を指定します。パラメータ step を省略した場合は、1 が規定値となります。パラメータ start はパラメータ stop より小さくても、大きくても構いません。いずれの場合も、データはしかるべき方向 (正か負) にステップします。最終値に対して余った分は、無視されます。
data(1,5)
は、数値範囲 {1,2,3,4,5}
を返します。data(10,1,2)
は、数値範囲 {10,8,6,4,2}
を返します。※ Note: 引数 start と stop が等しい場合は、step の数だけ start の数値を返します。例えば、data(1,1,4) は、{1,1,1,1} を返します。
|
data
説明
The data function generates a range of numbers from a starting number to an end number, in specified increments.
構文
All arguments must be scalar. The start argument specifies the beginning number and the end argument sets the last number. If the step parameter is omitted, it defaults to 1. The start parameter can be more than or less than the stop parameter. In either case, data steps in the correct direction. Remainders are ignored.
例
The operation data(10,1,2) returns the values {10,8,6,4,2}.
Note: If start and stop are equal, this function produces a number of copies of start equal to step. For example, the operation data(1,1,4) returns {1,1,1,1}.