%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This is how to plot the data points and regression line
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% We want to load data from the regression script first
regression

% First erase any existing plots
clg


title "People's weight vs. height"
xlabel "Height"
ylabel "Weight"

%
% We plot weight vs. height, use formatting string "@"
% to get points instead of lines
%
plot(P(:,1),P(:,2),"@")


% 
% When we want to add new plots to the existing one
% we must say this to prevent the plot from being erased
%
hold


% This is how we can plot the line weight = a * height + b
plot(P(:,1), a * P(:,1) + b)

% The same thing
plot(P(:,1), A * u)
