Taking a course and running through a very simple example, but my Figure opens with just a blank black image. The data looks like it is loaded properly into X and y. Any guidance would be great.
clear ; close all; clcfprintf('Plotting Data ...\n')data = load('ex1data1.txt');X = data(:, 1); y = data(:, 2); m = length(y);% Plot Data
plotData(X, y);fprintf('Program paused. Press enter to continue.\n');pause; % Function %
function plotData(x, y)figure; plot(x, y, 'rx', 'MarkerSize', 10);ylabel('Profit in $10,000s');xlabel('Population of City in 10,000s');end
Best Answer