1function plotData(X, y) 2%PLOTDATA Plots the data points X and y into a new figure 3% PLOTDATA(x,y) plots the data points with + for the positive examples 4% and o for the negative examples. X is assumed to be a Mx2 matrix. 5% 6% Note: This was slightly modified such that it expects y = 1 or y = 0 7 8% Find Indices of Positive and Negative Examples 9pos = find(y == 1); neg = find(y == 0); 10 11% Plot Examples 12plot(X(pos, 1), X(pos, 2), 'k+','LineWidth', 1, 'MarkerSize', 7) 13hold on; 14plot(X(neg, 1), X(neg, 2), 'ko', 'MarkerFaceColor', 'y', 'MarkerSize', 7) 15hold off; 16 17end 18 19