![]() |
PING
0.9
Statistical data handling and processing in production environment
|
Generate a list of linearly spaced NUMERIC values as an arithmetic progression.
len : (option) lenght of the output generated list; it can be omitted if and only if all other options below (e.g., start, end and step) are present, and then it is set to floor[(end - start)/ step + 1];start : (option) starting value of the generated list, i.e. the first element in the output list will be start; default: start=1; when omitted, it is set to:end - step * (len-1) when all other options are present,1 otherwise;step : (option) "step" between the items in the generated list, i.e. the difference/space between two consecutive items in the output list will be equal to step; step must be non-zero; when omitted, it is set to:(end-start)/(len-1) when all other options are present,1 otherwise; further note that step is "forced" to 1 when start and end are passed, but len is not;end : (option) ending value of the generated list; note that depending on the other settings (e.g., len, start and step), the last element in the output list will not necessary be equal to end; when omitted, it is set to: start + (len - 1) * step;sep : (option) character/string separator in input list; default: %quote( ), i.e. sep is blank.seq : output arithmetic list of evenly spaced items of lenght len and of the form start start+step start+2*step ....
The following examples:
return seq1=1 2 3 4 5 6 7 8 9 10, seq2=10 12 13 14 15 16 17 18 19 20, and seq3=2 4 6 8 10 12 14 16 18 20, respectively, while:
return seq1=10 9 8 7 6 5 4 3 2 1 and seq2=19 18 17 16 15 14 13 12 11 10. Note also that:
will return seq1=1 4 7 10 13 16 19, hence excluding 20 from the list.
Run macro %_example_list_sequence for examples.
step is positive (resp. negative), the last element in the output list is the largest value start + i * step that is less (resp. greater) than or equal to end.linspace and colon, : operators in Matlab, and xrange operator in Python.