title: Matlab: Criteria for displaying screens to subjects
body: <p>I am delivering a psychology experiment in Matlab, where screens with questions will be presented to subject. The screen will also collect and display the subjects' responses. For example: Screen displays '2+3' and also displays what participant types (say, 99999), until they press enter. </p>
  
  <p><strong>GOAL: get it to stop displaying the question after 16 seconds if the participant has not yet pressed enter. (That is, stop displaying the screen if time=16sec OR if subject presses Enter.)</strong> </p>
  
  <p>The problem revolves around the following code:</p>
  
  <pre><code>    While CurrentTime&lt;TimeOut
  
      respond=GetChar() &lt;-(Waits till user press enter)
  
      end
  </code></pre>
  
  <p>So whatever the statements we add before/after capturing respond statements is not executed.</p>
  
  <p>Any help on how to work around this issue would be greatly appreciated! Thanks.</p>