# HG changeset patch # User Rik # Date 1377063308 25200 # Node ID 6ba5b1dadd6149cce45af308d1884a6b05200d20 # Parent 68bcac3c043a282da6261e53b9f0cbb40914dde8 plotmatrix.m: Replace ifelse() construction with if/endif. * scripts/plot/plotmatrix.m: Replace ifelse() construction with if/endif. Move argument return out of unwind_protect to end of function. diff --git a/scripts/plot/plotmatrix.m b/scripts/plot/plotmatrix.m --- a/scripts/plot/plotmatrix.m +++ b/scripts/plot/plotmatrix.m @@ -72,19 +72,15 @@ print_usage (); endif - oldfig = ifelse (isempty (bigax2), [], get (0, "currentfigure")); + oldfig = []; + if (! isempty (bigax2)) + oldfig = get (0, "currentfigure"); + endif unwind_protect bigax2 = newplot (bigax2); [h2, ax2, p2, pax2] = __plotmatrix__ (bigax2, varargin{:}); - if (nargout > 0) - h = h2; - ax = ax2; - bigax = bigax2; - p = p2; - pax = pax2; - endif axes (bigax2); ctext = text (0, 0, "", "visible", "off", "handlevisibility", "off", "xliminclude", "off", @@ -98,6 +94,14 @@ endif end_unwind_protect + if (nargout > 0) + h = h2; + ax = ax2; + bigax = bigax2; + p = p2; + pax = pax2; + endif + endfunction