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?
>

Reply via email to