I wonder if there\'s a possibility to create a two dimensional array and to quickly access any horizontal or vertical sub array in it?
I believe we can access a hor
You didn't state your actual goal, but maybe this can help:
require 'matrix' # bundled with Ruby m = Matrix[ [1, 2, 3], [4, 5, 6] ] m.column(0) # ==> Vector[1, 4]
(and Vectors acts like arrays)
or, using a similar notation as you desire:
m.minor(0..1, 2..2) # => Matrix[[3], [6]]