MATLAB: Apply a skew normal distribution to a normal distribution

skew normal distribution graphStatistics and Machine Learning Toolbox

Hi All,
I am trying to apply a skew normal distribution to a graph, at the moment I have a perfect shaped bell curve as seen here,
The center of the curve is at 250, if I wanted to skew the graph slightly to right(at a number of my choosing, as in I can input where I want the peak to be) while maintaining the height, how would I go about it, I believe that under the section 'Definition' of this link https://en.wikipedia.org/wiki/Skew_normal_distribution contains the answer but I have been unable to successfully implement it,
Thanks,
P.S. These are the lines of code that create the graph
x=linspace(0,dimensions(1),dimensions(1)+1);
y = gaussheight.*exp(-(((x-pPressureElipse(4))./xrad).^2));

Best Answer

gaussian = @(x) (1/sqrt((2*pi))*exp(-x.^2/2))
skewedgaussian = @(x,alpha) 2*gaussian(x).*normcdf(alpha*x)
plot(x, gaussian(x))
hold on
plot(x, skewedgaussian(x, 4))
plot(x, skewedgaussian(x, -4))
plot(x, skewedgaussian(x, 1))
plot(x, skewedgaussian(x, -1))