如何在julia中找到矩阵索引?

如何在julia中找到矩阵索引?,julia,Julia,如何达到矩阵的指数。例如: m 3×5 Array{Int64,2}: 1 2 1 2 3 1 2 3 1 2 2 2 2 2 0 is the matrix. for accessing indices in first row these functions used. s=ind2sub(m,find( x -> x == 1, m[:,1] )) ([1, 2], [1, 1]) but for 2 s=ind2sub(m,find( x -

如何达到矩阵的指数。例如:

 m
3×5 Array{Int64,2}:
 1  2  1  2  3
 1  2  3  1  2
 2  2  2  2  0

is the matrix. for accessing indices in first row these functions used. 

s=ind2sub(m,find( x -> x == 1, m[:,1] ))
([1, 2], [1, 1])

but for 2
s=ind2sub(m,find( x -> x == 2, m[:,1] ))
([3], [1])

it didn't find the fist 2 in indices[1,2]

and also for 3

julia> s=ind2sub(m,find( x -> x == 3, m[:,1] ))
(Int64[], Int64[])

there was not any indices. 
for more explanation 
indices are need to make y. y is made from m that is included binary elements. y[i=1:5,k=1:3,t=1:3]
y[:,:,1]=[1 0 0;0 1 0;1 0 0;0 1 0;0 0 1]
y[:,:,2]=[1 0 0;0 1 0;0 0 1;1 0 0;0 1 0]
y[:,:,3]=[0 1 0;0 1 0;0 1 0;0 1 0;0 0 0]
你能帮助我怎样才能得到正确的指数吗。
非常感谢。

如果您切换到Julia 1.0+,您可以使用
CartesianIndices
function.wooow,它非常有用。我真的很感激。如果你切换到Julia 1.0+你可以使用
CartesianIndices
function.wooow,这非常有用。我真的很感激。