如何在高斯3D上绘制球体?

时间:2020-08-09 06:01:37

标签: matlab matlab-figure

我想在3D高斯上方创建一个球形的形状。

类似这样的东西:

Sphere on 3D Gaussian

为了绘制高斯,我写了tihs:

false

对于球形:



% isotropic Gaussian parameters
n = 100; % resolution
s = 2; % width

x = linspace(-5,5,n);
[X,Y] = meshgrid(x);

gaus2d = exp( -(X.^2 + Y.^2 )/(2*s^2));

figure(1), clf
surf(x,x,gaus2d)

问题是:我不知道如何在高斯上方移动球体。如何在高斯顶上转移球体?

1 个答案:

答案 0 :(得分:0)

您可以在ordner中向球体的z值添加一个常数,以将其“提升”:

ListView
相关问题