maxabs(A,dims)
maxabs(A, dims)
Compute the maximum absolute values over given dimensions.
Examples
julia> maxabs([-3,-11])
11
julia> maxabs([3,11])
11
-
Find the maximum absolute value in an array:
julia> arr = [3, -5, 2, -9, 7]; julia> maxabs(arr) 9
This example calculates the maximum absolute value in the array
arr
. -
Compute the maximum absolute value in a range:
julia> range = -10:10; julia> maxabs(range) 10
It determines the maximum absolute value in the given range.
- Find the maximum absolute value in a vector of complex numbers:
julia> complex_nums = [2 + 3im, -4 - 6im, 5 + 1im]; julia> maxabs(complex_nums) 8.48528137423857
Here, it calculates the maximum absolute value among the complex numbers.
Common mistake example:
julia> maxabs("hello")
ERROR: MethodError: no method matching maxabs(::String)
In this example, the input type is not compatible with the maxabs
function. It can only be used with collections of numeric values. Make sure to provide a valid collection of values to compute the maximum absolute value.
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.