julia中的矩阵给出了列输出

use*_*579 0 julia

也许我错过了一些东西,但考虑下一个矩阵:

julia> a = [[0,1,1,1,1,0,0,0,1] [1,0,1,0,1,1,1,0,0] [1,1,0,0,0,0,1,1,1] 
[1,0,0,0,1,0,0,0,0] [1,1,0,1,0,0,0,0,0] [0,1,0,0,0,0,1,0,0]
[0,1,1,0,0,0,0,0,1] [0,0,1,0,0,0,0,0,1] [1,0,1,0,0,0,0,1,0]]

9x9 Array{Int64,2}:
 0  1  1  1  1  0  0  0  1 # <-- [0,1,1,1,1,0,0,0,1]
 1  0  1  0  1  1  1  0  0 # <-- [1,0,1,0,1,1,1,0,0]
 1  1  0  0  0  0  1  1  1 # <-- [1,1,0,0,0,0,1,1,1]
 1  0  0  0  1  0  0  0  0 # <-- [1,0,0,0,1,0,0,0,0]
 1  1  0  1  0  0  0  0  0 # <-- [1,1,0,1,0,0,0,0,0]
 0  1  0  0  0  0  0  0  0 # <-- [0,1,0,0,0,0,1,0,0] ***
 0  1  1  0  0  1  0  0  0 # <-- [0,1,1,0,0,0,0,0,1] ***
 0  0  1  0  0  0  0  0  1 # <-- [0,0,1,0,0,0,0,0,1]
 1  0  1  0  0  0  1  1  0 # <-- [1,0,1,0,0,0,0,1,0] ***
Run Code Online (Sandbox Code Playgroud)

朱莉娅提供的输出是错的,对吧?

DSM*_*DSM 9

这种表示法意味着您按而不是行构建数组:

julia> a = [[1,2] [3,4]]                                                                                                                                            
2x2 Array{Int64,2}:                                                                                                                                                 
 1  3                                                                                                                                                               
 2  4                                                                                                                                                               

julia> a = [[1 2];[3 4]]                                                                                                                                            
2x2 Array{Int64,2}:                                                                                                                                                 
 1  2                                                                                                                                                               
 3  4      
Run Code Online (Sandbox Code Playgroud)

所以你得到了你认为自己的阵列的转置.