title: Plotting on figures where the number of figures isn't a factor of the number of plots
body: <p>I'm looking for a way to plot 30 columns of data from a matrix equally on say, U number of figures, so far I have a way to to do this for factors of 30 however I'm now struggling to get the code to work for say U = 7.</p>
  
  <p>The code needs to plot the columns of data as equally as possible over the specified number of figures U, each column of data represents a different sensor so each will be a different plot.</p>
  
  <p>What I have so far (Thanks to Benoit_11) is:</p>
  
  <pre><code>ColPerFig = size(Data,2)/NumFigures; %// Number of columns to plot per figure
  
  ColStart = 1:ColPerFig:size(Data,2) %// Indices of the starting columns to plot
  
  %// Plot
  for k = 1:NumFigures;    
  hFig(k) = figure;        
  plot(Data(:,ColStart(k):ColStart(k)+ColPerFig-1));
  end
  </code></pre>
  
  <p>Where "data" is the matrix of 4000x30 and "NumFigures" is the number of figures U.</p>
  
  <p>If anyone has any ideas to modify this code so it also works for non factors of 30 I would appreciate it.</p>
  
  <p>Thanks</p>
  
  <p>GibGib    </p>