mean of elements of a matrix

1 vue (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 31 Mar 2018
I have a matrix A. I want to take an average of all elements of A. Please advise.

Réponse acceptée

David Fletcher
David Fletcher le 31 Mar 2018
mean(A(:))
Gives the mean of the entire matrix

Plus de réponses (2)

Rana Hamza
Rana Hamza le 20 Jan 2023
Take average as the mean of whole matrix

Image Analyst
Image Analyst le 20 Jan 2023
theAverage = mean(A, 'all')
% or
theAverage = mean2(A) % In the Image Processing Toolbox.

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by