changeset 69:456e3f722147

showalgo: fix handling of the jackpot casex
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 18 May 2016 21:44:38 -0400
parents 5510ac95a3d3
children 430f958f007c
files talk/code/showalgo.m
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/talk/code/showalgo.m
+++ b/talk/code/showalgo.m
@@ -21,6 +21,10 @@
 pause
 
 for iter = 1:length(Am)
+  if iter > rows(L)
+    break
+  endif
+
   ## Reset the image
   imgH = origH;
 
@@ -46,10 +50,6 @@
   imshow(imgH);
   pause
 
-  if iter == length(Am)
-    break;
-  endif
-
   ## Check the left side
   imgLeft = imgH;
   red = imgH(:, :, 1);