summaryrefslogtreecommitdiff
path: root/Year_3/MMS/lecture_20211123.m
blob: 0038f724594f03396776a69cd7b2c77289702696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
fish = readtable("fish.txt");
p = table2array(fish(:, 2)); % Import the Price 1970 col from "fish.txt"

mean(p);
median(p);
min(p);
max(p);
range(p);

xvar = var(p);
xdev = std(p);
sqrt(xvar) == xdev; % Prints "1"

% ---
load("nations.mat");
MC = cov(nations);
size(MC);
data1 = nations(:, 1);
data2 = nations(:, 2);

corrcoef(data1, data2);

% plot(data1, data2, 'x');

load("T.mat");
Tarray = table2array(T);
sp = Tarray(:, 1);
dn = Tarray(:, 2);
corr = corrcoef(sp, dn);

disp(corr);
plot(sp, dn, 'x')
xlabel("Speed");
ylabel("Density");

load earth;
histogram(earth);
histfit(earth);
quantile(earth, 2);