From dd25997cb2d459485ba6948b8e0ceeb28edce176 Mon Sep 17 00:00:00 2001 From: Aiga SUZUKI Date: Wed, 12 Oct 2016 13:47:56 +0900 Subject: [PATCH] rework figure handle operations for R2014 later figure handles (such as `gcf`) returns object, instead of numbers, in R2014 later. --- textureSynthesis.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/textureSynthesis.m b/textureSynthesis.m index 378fbfe..39fbaf6 100644 --- a/textureSynthesis.m +++ b/textureSynthesis.m @@ -117,14 +117,18 @@ end end -imf = max(1,gcf-1); snrf = imf+1; +current_gcf = gcf; + +imf = max(1,current_gcf.Number - 1); snrf = imf+1; figure(imf); clf subplot(1,2,1); grayRange = showIm(im,'auto',1); title('Starting image'); drawnow prev_im=im; -imf = max(1,gcf-1); +current_gcf = gcf; + +imf = max(1, current_gcf.Number - 1); figure(imf); clf;showIm(im,'auto',1); title(sprintf('iteration 0'));