mean!

mean!(r, v)

Compute the mean of v over the singleton dimensions of r, and write results to r.

Examples

julia> r = [0.0, 0.0, 0.0];
julia> v = [1.0, 2.0, 3.0];
julia> mean!(r, v)
3-element Array{Float64,1}:
 2.0
 2.0
 2.0

This example calculates the mean of the elements in v and assigns the result to each element of r. The resulting array r will have the same size as v but with each element set to the mean 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.

*Required Field
Details

Checking you are not a robot: