The command
will return surface normals to surface Z. See:
https://www.mathworks.com/help/matlab/ref/surfnorm.html
However these normals will change from point to point. You need the equation of the best fit plane to obtain a single over-all normal to your points. For a plane with equation
its normal is the vector v = [a,b,c]. To make it of unit length do:
As I think you are aware, the angle between the normals to two planes is the same as the angle between those planes. The angle between two 3D vectors v1 and v2 is:
ang = atan2(norm(cross(v1,v2)),dot(v1,v2));
Best Answer