From a44b9ed57ffebfa5b13b29e94c7da97bed99911b Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 29 Nov 2021 22:30:01 +0100 Subject: mms: add lecture --- Year_3/MMS/normal_distribution.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Year_3/MMS/normal_distribution.m (limited to 'Year_3/MMS/normal_distribution.m') diff --git a/Year_3/MMS/normal_distribution.m b/Year_3/MMS/normal_distribution.m new file mode 100644 index 0000000..5250a84 --- /dev/null +++ b/Year_3/MMS/normal_distribution.m @@ -0,0 +1,14 @@ +function fn = normal_distribution(data) + mu = mean(data); + sig = var(data); + + f = @(x) (1/sig/sqrt(2*pi))*exp(-0.5*(x-mu).^2/sig^2); + xmin = min(data); + xmax = max(data); + + deltax = abs(xmax-xmin)/50; + x = xmin:deltax:xmax; + y = f(x); + + plot(x, y); +end \ No newline at end of file -- cgit v1.2.3-18-g5258