We say x is a normal or Gaussian random variable with parame
Solution
Answer a:
Mu = input(\'Mean of the function\');
 Sigma = input(\'Enter deviation \');
 x = -6:0.0001:6;
 g = g_d(Mu,Sigma);
 c = c_d(Mu,Sigma);
 function g = g_d(Mu,Sigma)
 a = 1/sqrt(2*3.1412*Sigma*Sigma);
 g1 = (x - Mu)/(sqrt(2)*Sigma);
 g = a*exp(-(g1*g1));
 plot(x,g);
 end
 function c = c_d(Mu,Sigma)
 b = (x - Mu) / (sqrt(2*Sigma*Sigma));
 c = 0.5*(1 + erf(b));
 plot(x,c);
 end
Answer b:
x = -6:0.0001:6;
function g = g_d(Mu,Sigma)
 a = 1/sqrt(2*3.1412*Sigma*Sigma);
 g1 = (x - Mu)/(sqrt(2)*Sigma);
 g = a*exp(-(g1*g1));
 plot(x,g);
 end
 function c = c_d(Mu,Sigma)
 b = (x - Mu) / (sqrt(2*Sigma*Sigma));
 c = 0.5*(1 + erf(b));
 plot(x,c);
 end
u1 = 0, s1 = 1,u2=0,s2=0.1,u3=0,s3=0.01,u4=-3,s4=1,u5=-3,s5=0.1,u6=-3,s6=0.01;
figure 1
subplot(2,3,1);
y1 = g_d(u1,s1);
plot(x,y1);
subplot(2,3,2);
y2 = g_d(u2,s2);
plot(x,y2);
subplot(2,3,3);
y3 = g_d(u3,s3);
plot(x,y3);
subplot(2,3,4);
y4 = g_d(u4,s4);
plot(x,y4);
subplot(2,3,5);
y5 = g_d(u5,s5);
plot(x,y5);
subplot(2,3,6);
y6 = g_d(u6,s6);
plot(x,y6);
figure 2
subplot(2,3,1);
z1 = c_d(u1,s1);
plot(x,z1);
subplot(2,3,2);
z2 = c_d(u2,s2);
plot(x,z2);
subplot(2,3,3);
z3 = c_d(u3,s3);
plot(x,z3);
subplot(2,3,4);
z4 = c_d(u4,s4);
plot(x,z4);
subplot(2,3,5);
z5 = c_d(u5,s5);
plot(x,z5);
subplot(2,3,6);
z6 = c_d(u6,s6);
plot(x,z6);
Answer c:
effect of u shift the plot in axis accordinly and sigma effects in spreadness of the plot / function. More the value of sigma more spread.



