The bell-shaped Gaussian probability density function, f(x)=12exp[12(x)2]f(x)=12
ID: 3604724 • Letter: T
Question
The bell-shaped Gaussian probability density function,
f(x)=12exp[12(x)2]f(x)=12exp[12(x)2]
is one of the most widely used functions in science and technology. The parameters of the function ([,+][,+], >0>0) are prescribed real numbers. Write a MATLAB script for evaluating this function when =0=0, =2=2, x=1x=1.
Explanation / Answer
code:-
m = 0;
sig = 2;
x = 2;
%calculate gaussian probability density function
f = 1/(sig*sqrt(2*pi)) .* exp(-((x-m)^2 / (2*(sig)^2)));
disp(f)
n = normpdf(x,m,sig); %normpdf(x,m,sig)
%cross check output using matlab command
disp(n)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.