I use the following code to plot the surface normal of a surface object using 2 methods with the SURFNORM and QUIVER3 functions:
[X,Y] = meshgrid(-2:0.25:2,-1:0.2:1);Z = X.* exp(-X.^2 - Y.^2);[U,V,W] = surfnorm(X,Y,Z);quiver3(X,Y,Z,U,V,W,0.5);hold on;surfnorm(X,Y,Z); % difference is here
colormap hsv;view(-35,45);axis ([-2 2 -1 1 -.6 .6]);hold off;grid on;legend('SURFNORM output to QUIVER3','Data','SURFNORM plot');
However, the surface normals created with the two methods do not coincide with one another when viewing them in a figure window.
Best Answer