how can i implement the Gaussian potential value code?

2 次查看(过去 30 天)
If there exists an arbitrary point x={x1,x2,...,xn}, the equation to calculate the potential function of data field on xi is:
potentialOfPoints.PNG
my question is: how can i implement this equation in matlab?

回答(1 个)

Adam Danz
Adam Danz 2020-2-12
编辑:Adam Danz 2020-2-13
x is a vector of length n.
I'm assuming sigma is std(x)
phi = sum(exp(-(vecnorm(x(:)-x(:).',2,1) / std(x)).^2));
phi(i) is the output for x(i).

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by