0% found this document useful (0 votes)
18 views

Plot Data

This function plots population data on the x-axis and profit data on the y-axis with red cross markers in a new figure window. It sets the y-axis label to 'Profit in $10,000s' and the x-axis label to 'Population of City in 10,000s'.

Uploaded by

lucascuesta
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Plot Data

This function plots population data on the x-axis and profit data on the y-axis with red cross markers in a new figure window. It sets the y-axis label to 'Profit in $10,000s' and the x-axis label to 'Population of City in 10,000s'.

Uploaded by

lucascuesta
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

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. % ====================== YOUR CODE HERE ====================== % Instructions: 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. % % Hint: You can use the 'rx' option with plot to have the markers % appear as red crosses. Furthermore, you can make the % markers larger by using plot(..., 'rx', 'MarkerSize', 10); figure; % open a new figure window
plot(x, y, 'rx', 'MarkerSize', 10); % Plot the data ylabel('Profit in $10,000s'); % Set the yaxis label xlabel('Population of City in 10,000s'); % Set the xaxis label

% ============================================================ end

You might also like