How to calculate the the minimum value in a vector(array) of vectors

I am trying to find the minimum on a vector of vectors. Is there an easy way of finding it?

Thanks

Hi @robo360! Is this what you’re after:

julia> minimum(minimum.([[1,2], [4,5]]))
1

?

4 Likes

Yep! Thanks @mauro3

1 Like

Just out of curiosity, what do you mean?

My example was a longer version of @mauro3’s. Here it is for posterity:

julia> a = [[10,20,30],[4,5,6,7,8],[9,60,2],[40,30,20]]
4-element Array{Array{Int64,1},1}:
 [10, 20, 30]
 [4, 5, 6, 7, 8]
 [9, 60, 2]
 [40, 30, 20]
julia> minimum(minimum.(a))
2

I deleted it because it was redundant.

Got it! I am new here. I thought that was your message.

No worries! Welcome to the forums.

1 Like