clear; clc;
[X, Y, Z] = peaks(20);
[U, V, W] = surfnorm(X, Y, Z);
quiver3(X, Y, Z, U, V, W, 0.5, 'r'); % 箭头长度、颜色
hold on
surf(X,Y,Z,'LineStyle','none'); % 网格线不显示
hold off
view(0, 90)
clear; clc;
[X, Y, Z] = peaks(20);
[U, V, W] = surfnorm(X, Y, Z);
quiver3(X, Y, Z, U, V, W, 0.5, 'r'); % 箭头长度、颜色
hold on
surf(X,Y,Z,'LineStyle','none'); % 网格线不显示
hold off
view(0, 90)