I want to find the average value for a 3D distribution. In other words I have a predefined volume, each point(location) in the volume has a different value. I want to approximate the average of these values. I would like help with finding a good as possible solution.

I have a script in Matlab that can calculate the value of one point in the 3D space. In 2D I can see how to do this more or less with superposition and matrices but I find it hard to extrapolate this to a 3D situation (and 4D space).

In my specific case the volume will be a cylinder.

Later on I will have to multiply these cloud values with another 3d distribution, however should I be able to understand this then I think I will be able to solve that problem.


Well, average has nice property that calculating it does not need all the data that you have. The process works in the following way:

  1. Start setting n=0, and sum=0.
  2. Step is doing: sum=sum+point_cloud[n]; n=n+1;
  3. After some steps, calculating the result is simply: avg = sum/n;

So you can basically choose how many points you're going to include to your results. The result gets more accurate depending on number of points you include.

Note that this one depends on "sampling" your distribution, i.e. you choose a point in 2d,3d,4d space - the choice is arbitrary, like you can use random point in a box or something, and then the sampling will fetch the value attached to your point.

  • $\begingroup$ That's great of course and I should have thought of that. Thank you very much. $\endgroup$ – Bob van de Voort Feb 7 '17 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.