x = [5 6 8 10 13 15 19 21]';
y = [9 10 11 13 17 21 27 37]';
c_ones = [1 1 1 1 1 1 1 1]';
V = [x, c_ones]
b = V'*y
V'*V;
a = b\(V'*V)
m = a(1);
c = a(2);
x_r = linspace(min(x), max(x));
y_r = m*x_r + c;
hold on;
plot(x, y, '*')
plot(x_r, y_r)
xlabel('number of fishermen')
ylabel('fish caught')
title('scatter plot of number of fishermen vs fish caught')
To embed this project on your website, copy the following code and paste it into your website's HTML: