How can I transform this matlab code into Julia

julia> vals, idx = findmax(A, dims=1)
([6 7 4], CartesianIndex{2}[CartesianIndex(2, 1) CartesianIndex(3, 2) CartesianIndex(3, 3)])

julia> vals
1×3 Matrix{Int64}:
 6  7  4

julia> idx
1×3 Matrix{CartesianIndex{2}}:
 CartesianIndex(2, 1)  CartesianIndex(3, 2)  CartesianIndex(3, 3)

If you need the row only and not the full index:

row = first.(Tuple.(idx))
1×3 Matrix{Int64}:
 2  3  3
4 Likes