mean of elements of a matrix

1 次查看(过去 30 天)
I have a matrix A. I want to take an average of all elements of A. Please advise.

采纳的回答

David Fletcher
David Fletcher 2018-3-31
mean(A(:))
Gives the mean of the entire matrix

更多回答(2 个)

Rana Hamza
Rana Hamza 2023-1-20
Take average as the mean of whole matrix

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

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by