forked from joemehr/MachineLearning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotData.m
More file actions
17 lines (13 loc) · 665 Bytes
/
plotData.m
File metadata and controls
17 lines (13 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure
% PLOTDATA(x,y) plots the data points and gives the figure axes labels of
% population and profit.
% Plot the training data into a figure using the "figure" and
% "plot" commands. Set the axes labels using the "xlabel" and
% "ylabel" commands. Assume the population and revenue data
% have been passed in as the x and y arguments of this function.
figure; % open a new figure window
plot(x, y, 'rx', 'MarkerSize', 10); % Plot the data
ylabel('Profit in $10,000s'); % Set the y-axis label
xlabel('Population of City in 10,000s'); % Set the x-axis label
end