7 views (last 30 days)

Hello !

I have a 1x301 array (vector V) of equally sparsed values generated with linspace(0,1,301) and I would like to create a gaussian from those values.

The gaussian should be centered on the middle of the vector V and the central value generated by the gaussian should be 1 (the sigma, spread, is not important).

I tried several ways to do it but I can't manage to obtain a bell curve distribution of Y values over my X axis.

So far I had:

V = linspace(0,L,301)

sigma = 1;

nu = V(length((V-1)/2));

x = V-nu;

T0 = (1/(sigma*sqrt(2)))*exp(-((1/2)*((x/sigma).^2)));

What should I write instead ? It feels like it comes from my gaussian expression.

Thank you in advance !

Vladimir Sovkov
on 11 Jan 2020

L=20;

V = linspace(0,L,301);

sigma = L/20;

T0 = exp(-((V-mean(V))/sigma).^2/2);

plot(V,T0);

Vladimir Sovkov
on 11 Jan 2020

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.