Calculating an average in an n x m array that contain zeros
12 views (last 30 days)
Show older comments
How can i calculate an average in an array where data in the columns are zero values and I don't want the zero to be considered when computig an average.
For example: A= [2 2 ; 2 4; 1 0] >>> mean(A) results in 1.667 2 >>>the answer I want is 1.667 3
Any assistance is much appreciated.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!