Gaussian distribution in Matlab

조회 수: 5 (최근 30일)
Dan Escu
Dan Escu 2020년 11월 11일
댓글: Dan Escu 2020년 11월 12일
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
Durganshu
Durganshu 2020년 11월 12일
편집: Durganshu 2020년 11월 12일
What is A? Do you know anything about the variation of x as well?
Dan Escu
Dan Escu 2020년 11월 12일
Sorry, there's no A. I don't know anything about x ... I only know the values of M and D.

댓글을 달려면 로그인하십시오.

답변 (1개)

Alan Stevens
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 CenterFile 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!

Translated by