How do I write a matlab function for the following expression?

回答 (1 件)

Pranjal Kaura
Pranjal Kaura 2021 年 10 月 29 日

0 投票

Hey
Here is a code snippet for the required function
function f_x = PDF(x, u, sigma)
f_x = exp(-(x - u).^2/(2*sigma.^2))/(sigma*sqrt(2*pi));
end
You can also use the 'normpdf' function.
Hope this helps!

製品

リリース

R2021b

質問済み:

2021 年 10 月 26 日

回答済み:

2021 年 10 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!