z=f(x,y) 的 Matlab 散点图,z 值位于点的顶部

Matlab scatter plot of z=f(x,y) with values of z on top of the points

我有一个来自方程 z=f(x,y) 的 Matlab 数据集。

因此,对于每组 (x,y),我都有一个对应的 z 值。我能否在 x,y 平面上绘制数据,在每个位置 打印 z 值 而不是点或彩色点?

figure;
hold on;
scatter(x,y);
ma = cellstr(num2str(z(:)));
text(x, y + <some_offset>, ma, 'FontSize', 10, 'Color', 'r');