diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2021-11-29 22:30:01 +0100 | 
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2021-11-29 22:30:01 +0100 | 
| commit | a44b9ed57ffebfa5b13b29e94c7da97bed99911b (patch) | |
| tree | 1a21706314e684cc35ac74e28d364236da161cf2 /Year_3/MMS/normal_distribution.m | |
| parent | 12eb2dc3d43e0a24e7713e1f470587ba97f3f2a0 (diff) | |
mms: add lecture
Diffstat (limited to 'Year_3/MMS/normal_distribution.m')
| -rw-r--r-- | Year_3/MMS/normal_distribution.m | 14 | 
1 files changed, 14 insertions, 0 deletions
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  |