As time moves along x-axis, the output value (may be freq or prob) be shown accordingly i.e. as time moves the values should increase initially till mean and then decrease. I have prespecified mean mu=10 and standard deviation sigma=2.
Asked
Active
Viewed 22 times
1 Answers
1
Do you mean you want to plot a Gaussian function? I am not sure if you also wanted some sort of animation. If not, you can modify the code below to turn off modification.
clear; close all; clc;
% Set the mean and standard deviation
mu = 10;
sigma = 2;
% Time t
t = linspace(0,20,101);
% The equation for a normal distribution
f = 1/(sqrt(2*pi)*sigma)*exp( -(t-mu).^2/(2*sigma^2));
hold on;
xlim([0,20]);
ylim([0,0.25]);
axis manual;
for i=1:length(t)
plot( t(1:i), f(1:i), 'b-');
pause(0.1);
end
hold off;
-
Additinally, If skewness and kurtosis are to be added, then how it can be generated... – M.Patil Nov 17 '17 at 06:55
-
@M.Patil That does not make sense. The normal distribution has a specific skewness and kurtosis. If you want to change those, you have to change distribution. – Nicky Mattsson Nov 17 '17 at 10:23