Hi
I was simply dabbling whilst learning - nothing specific.
Can I still sum?
Regards

On Thursday, 12 March 2015 09:50:19 UTC, Mauro wrote:
>
> > const x = rand(8) 
> > [ x[i-4:i-1] for i = 6] .. this gives me a 4 element array. 
>
> This seems a bit odd, what are you trying to achieve here?  Anyway it 
> produces a Array{Array{Float64,1},1}, i.e. an array of arrays containing 
> one array. 
>
> > I now want to sum the ouput - this is what I tried ... 
> > sum([ x[i-4:i-1] for i = 6]) ... what am I doing wrong? 
>
> This sums all first elements, second elements, etc.  As there is only on 
> array in the array, it doesn't do all that much. 
>

Reply via email to