Average or mean of matrix elements
Read an image into the workspace.
I = imread('liftingbody.png');
Compute the mean.
meanval = mean2(I)
meanval = 140.2991
A— Input data
Input data, specified as a numerical or logical array.
mean2 supports the generation of C
code (requires MATLAB®
Coder™). For more information, see Code Generation for Image Processing.
This function fully supports GPU arrays. For more information, see Image Processing on a GPU.