mean of elements of a matrix

1 visualizzazione (ultimi 30 giorni)
alpedhuez
alpedhuez il 31 Mar 2018
Risposto: Image Analyst il 20 Gen 2023
I have a matrix A. I want to take an average of all elements of A. Please advise.

Risposta accettata

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

Più risposte (2)

Rana Hamza
Rana Hamza il 20 Gen 2023
Take average as the mean of whole matrix

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

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by