ndwmean
ndwmean(array,weights,directions) calculates the n-dimensional weighted mean of an array. The size of the weighting array and the optional input "directions" determine the dimensions in which the weighted mean is applied (see examples). Supports NaN values.
Examples: x = rand(3,3,3,2)
ndwmean(x,rand(1,2)) % 4th dimension
ndwmean(x,rand(3,2),[2 4]) % 2nd and 4th dimensions
ndwmean(x,rand(1,3,1,2)) % 2nd and 4th dimensions
ndwmean(x,rand(1,3)) % 3rd dimension
ndwmean(x,rand(3,3)) % 2nd and 3rd dimensions
Cite As
Russell (2024). ndwmean (https://www.mathworks.com/matlabcentral/fileexchange/45229-ndwmean), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Language Fundamentals > Data Types > Time Series >
- MATLAB > Data Import and Analysis > Descriptive Statistics >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.