In [1]:
[ones(5) 2*ones(5)]
Out[1]:
5×2 Array{Float64,2}:
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
In [2]:
[ones(5), 2*ones(5)]
Out[2]:
2-element Array{Array{Float64,1},1}:
 [1.0, 1.0, 1.0, 1.0, 1.0]
 [2.0, 2.0, 2.0, 2.0, 2.0]
In [3]:
[1 2 3]
Out[3]:
1×3 Array{Int64,2}:
 1  2  3
In [4]:
[1, 2, 3]
Out[4]:
3-element Array{Int64,1}:
 1
 2
 3
In [5]:
[1, 2, 3:5]
Out[5]:
3-element Array{Any,1}:
 1   
 2   
  3:5
In [6]:
x = ones(5); y = 2*ones(5)
Out[6]:
5-element Array{Float64,1}:
 2.0
 2.0
 2.0
 2.0
 2.0
In [7]:
[x y]
Out[7]:
5×2 Array{Float64,2}:
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
In [8]:
hcat(x,y)
Out[8]:
5×2 Array{Float64,2}:
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
In [9]:
cat(dims=2, x, y)
Out[9]:
5×2 Array{Float64,2}:
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
 1.0  2.0
In [10]:
X = [1 2; 3 4]
Out[10]:
2×2 Array{Int64,2}:
 1  2
 3  4
In [11]:
M = [true false; false true]
Out[11]:
2×2 Array{Bool,2}:
 1  0
 0  1
In [12]:
X[M]
Out[12]:
2-element Array{Int64,1}:
 1
 4
In [13]:
X .* M
Out[13]:
2×2 Array{Int64,2}:
 1  0
 0  4