c
! www.simula.no/˜hpl
Array with a sequence of numbers
linspace(a, b, n) generates n uniformly spaced coordinates,
starting with a and ending with b
>>> x = linspace(-5, 5, 11)
>>> print x
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.]
Aspecialcompactsyntaxisalsoavailable:
>>> a = r_[-5:5:11j] # same as linspace(-5, 5, 11)
>>> print a
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4. 5.]
arange works like range (xrange)
>>> x = arange(-5, 5, 1, float)
>>> print x # upper limit 5 is not included!!
[-5. -4. -3. -2. -1. 0. 1. 2. 3. 4.]
Numerical Python – p. 243/728
Komentarze do niniejszej Instrukcji