How do I get the minimum value of an Array
, Vector
, or Matrix
in Julia?
The code min([1, 2, 3])
doesn't work.
How do I get the minimum value of an Array
, Vector
, or Matrix
in Julia?
The code min([1, 2, 3])
doesn't work.
The Julia manual: https://docs.julialang.org/en/v1/base/math/#Base.min
https://docs.julialang.org/en/v1/base/collections/#Base.minimum
min(x, y, ...)
Return the minimum of the arguments. Operates elementwise over arrays.
julia> min([1, 2, 3]...)
1
julia> min(2,3)
2
minimum(A, dims)
Compute the minimum value of an array over the given dimensions.
minimum!(r, A)
Compute the minimum value of A over the singleton dimensions of r, and write results to r.
julia> minimum([1, 2, 3])
1
min([1,2],[3,0])
for elementwise min
, etc. –
Equivocation minimum
, as of 1.1, is currently docs.julialang.org/en/latest/base/collections/#Base.minimum –
Maus To get the minimum of a vector, min() cannot be used but minimum() can
© 2022 - 2024 — McMap. All rights reserved.
minimum
, notmin
. – Nucleoside