minabs!

minabs!(r, A)

Compute the minimum absolute values over the singleton dimensions of r, and write values to r.

Examples

julia> r = [0, 0, 0];
julia> A = [-1, 2, -3];
julia> minabs!(r, A)
3-element Array{Int64,1}:
 1
 0
 0

This example calculates the minimum absolute values over the singleton dimensions of r and writes the values to r. In this case, the minimum absolute value of each element in A is taken, and the result is stored in the corresponding position in r.

Common mistake example:

julia> r = [0, 0, 0];
julia> A = [1, 2, 3];
julia> minabs!(r, A)
ERROR: MethodError: no method matching abs(::Array{Int64,1})

In this example, the mistake is providing an array A instead of a scalar value for the minabs! function. The function expects a scalar value for A and cannot compute the minimum absolute value of an array. Make sure to provide the correct input types to the function to avoid such errors.

See Also

cummax, eigmax, findmax, hist, hist!, hist2d, hist2d!, histrange, indmax, maxabs, maxabs!, maximum!, mean, mean!, median, median!, minabs, minabs!, minimum!, minmax, quantile!, realmax, std, stdm,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: