a guest Nov 9th, 2018 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. currkey=0;
  2. % do not move on until enter key is pressed
  3. while currkey~=1
  4.     pause; % wait for a keypress
  5.     currkey=get(gcf,'CurrentKey');
  6.     if strcmp(currkey, 'return') % You also want to use strcmp here.
  7.         currkey=1 % Error was here; the "==" should be "="
  8.     else
  9.         currkey=0 % Error was here; the "==" should be "="
  10.     end
  11. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand