title: How do I randomly select k points from N points in MATLAB?
body: <p>I use this code to create and plot <code>N</code> points:</p>
  
  <pre><code>N=input('No. of Nodes:');
  data = rand(N,2) % Randomly generated n no. of nodes
  x = data(:,1);
  y = data(:,2);
  plot(x,y,'*');
  </code></pre>
  
  <p>How do I choose <code>k</code> points (with probability <code>p=0.25</code>) out of <code>N</code> points, then color those <code>k</code> points red and leave the other points as <code>*</code>.</p>