Mercurial > octave-antonio
comparison scripts/plot/util/close.m @ 20145:f8d443fe0de3 stable
close.m: Silently accept null argument for Matlab compatibility.
* close.m: Check isempty (arg1) and don't complain if arg1 is null.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 29 Apr 2015 17:09:24 -0700 |
parents | 7e0e8fb16201 |
children |
comparison
equal
deleted
inserted
replaced
20143:cbce57ca9747 | 20145:f8d443fe0de3 |
---|---|
69 if (ischar (arg1) && strcmpi (arg1, "all")) | 69 if (ischar (arg1) && strcmpi (arg1, "all")) |
70 figs = (get (0, "children"))'; | 70 figs = (get (0, "children"))'; |
71 figs = figs(isfigure (figs)); | 71 figs = figs(isfigure (figs)); |
72 elseif (any (isfigure (arg1))) | 72 elseif (any (isfigure (arg1))) |
73 figs = arg1(isfigure (arg1)); | 73 figs = arg1(isfigure (arg1)); |
74 elseif (isempty (arg1)) | |
75 figs = []; # Silently accept null argument for Matlab compatibility | |
74 else | 76 else |
75 error ('close: first argument must be "all" or a figure handle'); | 77 error ('close: first argument must be "all" or a figure handle'); |
76 endif | 78 endif |
77 elseif (ischar (arg2) | 79 elseif (ischar (arg2) |
78 && (strcmpi (arg2, "hidden") || strcmpi (arg2, "force"))) | 80 && (strcmpi (arg2, "hidden") || strcmpi (arg2, "force"))) |