Gaussian distribution in Matlab
2 次查看(过去 30 天)
显示 更早的评论
Hi All, I am trying to plot a amplitude Gaussian distribution in Matlab.

How to get a Gaussian normal plot for 3 differents moments of time? I have values only for M, A and D
2 个评论
回答(1 个)
Alan Stevens
2020-11-12
Try something like
>> M = 1; D = 1; % Set your own values
c = @(t,x) M/sqrt(4*pi*D*t)*exp(-x.^2/(4*D*t));
x = -5:0.1:5;
t = [0.1 0.5 1];
C1 = c(t(1),x);
C2 = c(t(2),x);
C3 = c(t(3),x);
plot(x,C1,x,C2,x,C3),grid
legend(['t = ',num2str(t(1))],['t = ',num2str(t(2))],['t = ',num2str(t(3))]);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!