how can i implement the Gaussian potential value code?

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?

Antworten (1)

Adam Danz
Adam Danz am 12 Feb. 2020
Bearbeitet: Adam Danz am 13 Feb. 2020
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).

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018a

Gefragt:

am 11 Feb. 2020

Bearbeitet:

am 13 Feb. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by