There is currently no direct function to take the norm of a 2D array by dimension. The easiest way would probably be to do either of the 2 functions below:
julia> A = rand(5,4);
julia> f1(A,d=1) = sqrt.(sum(abs2,A,d))
f1 (generic function with 1 method)
julia> f2(A) = [vecnorm(A[:,i]) for i=1:size(A,2)]
f2 (generic function with 1 method)
julia> @btime f1($A)
128.103 ns (2 allocations: 224 bytes)
1×4 Array{Float64,2}:
1.08137 1.1315 1.23828 1.35529
julia> @btime f2($A)
327.377 ns (11 allocations: 736 bytes)
4-element Array{Float64,1}:
1.08137
1.1315
1.23828
1.35529
f1 is faster because it acts mostly in place. It also allows you to change the dimension more easily.
Maybe it is more intuitive think about list comprehension in this kind of problem (any problem with operation across matrices and vectors, really).
My favorite way to get a list of norms of the vectors represented as lines in a matrix is : norms = [norm(m[i,:]) for i=1:size(m)[1]]
It is not super compact as it would be in matlab, but perhaps more understandable as you can see that you are calculating some norm for each line of the matrix and getting a list of those norms. When I do this in matlab I always have to check if I’m calculating the norm “vertically” or “horizontally” in the matrix to make sure I’ll get what I want.