Ary6[1..2,0..-1]

At the following:
http://ruby.gfd-dennou.org/tutorial/gokuraku/index-e.html

Under “Index”, I want to ask about the following:

ary6 = NArray.sfloat(4,3).indgen!(1.02.0) # This line didn’t work

ary6[1…2,0…-1] # What is meant by this line? didn’t understand how
the output was formed

Thanks.

Hi,

On 03.09.2010 13:41, Abder-Rahman A. wrote:

At the following:
Dennou-Ruby Tutorial

Under “Index”, I want to ask about the following:

ary6 = NArray.sfloat(4,3).indgen!(1.02.0) # This line didn’t work

ary6[1…2,0…-1] # What is meant by this line? didn’t understand how
the output was formed

This is just another form of array slicing, see
class Array - RDoc Documentation for the details.

HTH

Can you clatfiy my question based on this? Still cannot get the idea.