2022-08-24 19:46:01 +08:00
|
|
|
|
# 高斯分布
|
|
|
|
|
|
|
|
|
|
## 一维高斯分布
|
|
|
|
|
|
|
|
|
|
$$G(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$
|
|
|
|
|
|
|
|
|
|
Matlab 图像绘制程序:
|
|
|
|
|
|
|
|
|
|
```m
|
|
|
|
|
sig=1;
|
|
|
|
|
mu=0;
|
|
|
|
|
x=-5:0.1:5;
|
|
|
|
|
gx=e.^(-(x-mu).^2/(2*sig^2))/(sig*sqrt(2*pi));
|
|
|
|
|
plot(x, gx)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 二维高斯分布
|
|
|
|
|
|
|
|
|
|
$$G(x,y)=Ae^{(-\frac{(x-x_0)^2}{2\sigma_x^2}+\frac{(y-y_0)^2}{2\sigma_y^2})}$$
|
|
|
|
|
|
|
|
|
|
Matlab 图像绘制程序:
|
|
|
|
|
|
|
|
|
|
```m
|
2022-08-24 19:50:22 +08:00
|
|
|
|
% A=1
|
|
|
|
|
% σx=σy=1
|
|
|
|
|
% x0=y0=0
|
2022-08-24 19:46:01 +08:00
|
|
|
|
x1 = [0:0.1:10];
|
|
|
|
|
y1 = [0:0.1:10];
|
|
|
|
|
[x,y] = meshgrid(x1,y1);
|
2022-08-24 19:50:22 +08:00
|
|
|
|
gxy = exp(-((x-5).*(x-5)+(y-5).*(y-5))/2);
|
2022-08-24 19:46:01 +08:00
|
|
|
|
surf(x, y, gxy);
|
|
|
|
|
```
|