And isn't there some inverse function to []?
I mean, if i have a Vector{Float64} [myrange] and want to convert it into a
FloatRange{Float64} myrange.
On Tuesday, July 1, 2014 2:35:03 PM UTC+2, Mauro wrote:
>
> > Mauro, is that the only difference, the memory allocation? Can I use
> ranges
> > for plotting, for instance?
>
> Ranges are basically just 3 numbers: start, step & stop. Just have a
> look at base/range.jl
>
> On whether they can be used instead of arrays depends on the
> implementation of the function in question. However, generally
> functions are implemented in terms of AbstractArray which Range (as well
> as Array) is a subtype of. Just try and if it doesn't work turn it into
> an array with [myrange].
>
> > On Tuesday, July 1, 2014 1:33:34 PM UTC+2, Mauro wrote:
> >>
> >> > If I define an array using the syntax
> >> >
> >> > a = [start:step:end]
> >> >
> >> > how can I later recover the step? I tried step(a), but that only
> seems
> >> to
> >> > work for integer ranges.
> >>
> >> Why not keep the range? It should work just like an array but use less
> >> memory:
> >>
> >> a = start:step:end
> >>
> >> and step works for float ranges:
> >>
> >> julia> step(0.5:6.1:40)
> >> 6.1
> >>
>
>