title: How to best print output to command window during a loop in Matlab?
body: <p>I have a loop which iterates through a list of ID numbers paired with a given stress value. The code works fine, except there is no guarantee that the lists have identical lengths. I currently have an <code>if isempty(stress_value)</code> loop with a <code>continue</code> statement if an ID number doesn't have corresponding stress value. All of this takes place in a <code>for id = 1:num_ids</code> loop.</p>
  
  <p>I am now trying to print this <code>id</code> value (class 'double') to the command line, if it doesn't have an assigned stress value, so if the <code>isempty</code> statement is True, prior to continuing out of the loop. As an example, if I set <code>num_ids</code> equal to 101, but the list I'm iterating through only has ID values 1-100, I want to output this 101 ID to the command line.</p>
  
  <p>I've tried printing as an error like this:</p>
  
  <pre><code>error(['The following ID does not have an assigned stress value: ',id])
  </code></pre>
  
  <p>Here <code>id</code> simply prints as <code>e</code> however when I try this in the command window, which I don't quite understand. When I run it in the script nothing is printed to the command window.</p>
  
  <p>I have also tried simply adding a display command for the id to the loop as follows, however when I run the code nothing shows up again:</p>
  
  <pre><code>disp(id)
  </code></pre>
  
  <p>Sorry for the simple question, but I have not found an effective way to do this yet, and would appreciate your feedback!</p>