On 3/28/11 6:28 AM, ObsessiveMathsFreak wrote:
This is a simple question, but I can't find anything in the
documentation about it.
I would like to declare a simple arithmetic sequence in sage. I use
this a lot for discrete plots, etc. In octave, syntax such as
[0:0.1:1] returns the sequence
0.0 0.2 0.4 0.6 0.8 1.0
Is there such a shorthand syntax for these kinds of sequences in sage?
I know about the shorthand [1..10] for integers, but this does not
seem to work for general arithmetic sequences. The range() function
also will not work correctly with non integer steps.
Almost exactly like Octave:
sage: [0.0, 0.1, .., 1.0]
[0.000000000000000, 0.100000000000000, 0.200000000000000,
0.300000000000000, 0.400000000000000, 0.500000000000000,
0.600000000000000, 0.700000000000000, 0.800000000000000,
0.900000000000000, 1.00000000000000]
Thanks,
Jason
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org