Hello!
Suppose I have an array of different values, Result
.
Usually one would write; clamp!(Result,LowerLimit,HigherLimit)
. Is there a way to make it “one-sided” such that I only specify a lower limit?
Kind regards
Hello!
Suppose I have an array of different values, Result
.
Usually one would write; clamp!(Result,LowerLimit,HigherLimit)
. Is there a way to make it “one-sided” such that I only specify a lower limit?
Kind regards
There’s an example in the docs:
julia> clamp.((-4:4)', 0, Inf)
1×9 Matrix{Float64}:
0.0 0.0 0.0 0.0 0.0 1.0 2.0 3.0 4.0
Thanks! Had not realized it was this simple I was trying “nothing” instead of Inf
Kind regards
The right way to do this is not to use clamp
, but max
:
max.((-4:4)', 0)