title: Matlab - Plotting PCA Analysis
body: <p>I have a 21x5 sized matrix (top5features) containing values for 5 different feature types extracted from 21 cancer nodules. I am trying to apply principal component analysis on my data and plotting the results, but am having trouble understanding how to do so. The following is my code so far, but it only plots a portion of the data and I do not believe it is what I am going for:</p>
  
  <pre><code>top5features = features(1:21,[42 55 61 62 60]);
  [W, pc] = princomp(top5features);
  pc = pc'; W = W';
  plot(pc(1,:),pc(2,:),'.');
  title('{\bf PCA} of Top 5 Features')
  </code></pre>
  
  <p>My goal is to make the plot so that it has 21 points, with each point pertaining to a specific nodule. These 21 nodules are also divided into two groups, and if possible I would like to color code them according to the group they belong to. I am somewhat of a beginner using Matlab and any help would be appreciated.</p>