How to get the minimal value of Array/Vector/Matrix in Julia?
This code min([1, 2, 3])
doesn't works...
M = min( A ) returns the minimum elements of an array. If A is a vector, then min(A) returns the minimum of A . If A is a matrix, then min(A) is a row vector containing the minimum value of each column of A .
Arrays are mutable type collections in Julia, hence, their values can be modified with the use of certain pre-defined keywords. Julia allows adding new elements in an array with the use of push!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With