Command: getinterval

NEST HelpDesk Command Index NEST Quick Reference

Name:
 getinterval - Return a subsequence of a string or array.
Synopsis:
 (string1) a b getinterval -> (string2)
[array1]  a b getinterval -> [array2]
Description:
getinterval returns a new container with b elements 
starting at element a
Note that getinterval can only handle indices from 0 to N-1 
where N is the length of the original array

If other values are given (i.e. indices which do not exist in the array), the function throws a RangeCheckError

If negative values are given, getinterval throws a PostiveIntegerExpectedError

If b = 0, getinterval returns an empty array

Examples:
 (spiketrainsimulation) 5 5 getinterval -> train
(spiketrainsimulation) 0 5 getinterval -> spike
[23 24 25 26 27 30] 0 2 getinterval -> [23 24]
[23 24 25 26 27 30] 2 3 getinterval -> [25 26 27]
[23 24 25 26 27 30] 0 6 getinterval -> [Error]: RangeCheck
Author:
 docu edited by Sirko Straube
SeeAlso:get put putinterval Take
Source:
 /home/abuild/rpmbuild/BUILD/nest-2.4.1/sli/slidata.cc

NEST HelpDesk Command Index NEST Quick Reference

© 2000-2010 The NEST Initiative