Sum up meshgrids with different sizes and positions that overlap each other

Heya,
i'm having some troubles to get Matlab to do what i want. Im building a meshgrid and calculate a z-value for it. I'm gonna plot that via surf. Than im going to rotate the grid and get the new x,y,z matrices via the get function. So far everything works well. But when i'm doing that in a for loop i am getting differnet grids with different x and y because of a different rotation angle. If i plot them all in the same figure they overlap each other. The overlaping is wanted - but i want to have a cummulative figure of all the surf-plots that sums up the values at the points where surf-plots overlap. I have no Idea how to sum up grids with differnt sizes and positions. Maybe anyone of u can help?
Thanks alot...

4 Comments

Are the rotations multiples of 90 degrees? Or at least of 45 degrees? Or is the angle variable (e.g., could be 14.8 degrees) ?
the angle is totaly variable. So it could also be 14.8 degrees
11 years after and here I am also faced with the same problem. I've tried getting the vector sum of all rotated coordinates both in spherical and cartesian coordinates but the code looks messy and I still can't get the cummulative sum of the rotated surfaces. Hope anyone could help.
@Miguel it would be better to ask a separate question providing your code and any necessary/relevant information.

Sign in to comment.

Answers (1)

Rather than using handle graphics to do this, it sounds like it would be better to use imrotate to make the various rotations of the Z array and then add those up.

Asked:

on 26 Jun 2012

Answered:

on 2 Sep 2023

Community Treasure Hunt

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

Start Hunting!