You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

plotDataPoints.m 434 B

8 years ago
1234567891011121314
  1. function plotDataPoints(X, idx, K)
  2. %PLOTDATAPOINTS plots data points in X, coloring them so that those with the same
  3. %index assignments in idx have the same color
  4. % PLOTDATAPOINTS(X, idx, K) plots data points in X, coloring them so that those
  5. % with the same index assignments in idx have the same color
  6. % Create palette
  7. palette = hsv(K + 1);
  8. colors = palette(idx, :);
  9. % Plot the data
  10. scatter(X(:,1), X(:,2), 15, colors);
  11. end

机器学习

Contributors (1)