thanks. That was pretty stupid of me. I was creating 2 dimensional arrays of 2d array and then banging my head why can't I get simple vectors when I used what you used exactly.
On Tuesday, 10 June 2014 21:08:59 UTC-4, Sam L wrote: > > See http://julia.readthedocs.org/en/latest/manual/arrays/#indexing > > For example: > julia> x = [i * j for i in 1:3, j in 1:5] > 3x5 Array{Int64,2}: > 1 2 3 4 5 > 2 4 6 8 10 > 3 6 9 12 15 > > All rows, first two columns: > julia> x[:, 1:2] > 3x2 Array{Int64,2}: > 1 2 > 2 4 > 3 6 > > First 2 rows, 2nd and 4th column: > julia> x[1:2, [2,4]] > 2x2 Array{Int64,2}: > 2 4 > 4 8 > > On Tuesday, June 10, 2014 5:46:33 PM UTC-7, Zahirul ALAM wrote: >> >> I have a simple question: How do I select all columns or particular >> columns from a matrix. it is very straightforward to select a row. I have >> been struggling for the last two hours. how do I do this? the manual does >> not seem to talk about it. or am I missing it? >> >
