Cursera: machine learning ex7.

This commit is contained in:
Vahagn Khachatryan
2015-03-30 12:17:51 +04:00
parent 29c396874e
commit ed6828bf1a
22 changed files with 1401 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
function plotDataPoints(X, idx, K)
%PLOTDATAPOINTS plots data points in X, coloring them so that those with the same
%index assignments in idx have the same color
% PLOTDATAPOINTS(X, idx, K) plots data points in X, coloring them so that those
% with the same index assignments in idx have the same color
% Create palette
palette = hsv(K + 1);
colors = palette(idx, :);
% Plot the data
scatter(X(:,1), X(:,2), 15, colors);
end