MATLAB Answers

zin zin
0

Undefined function or variable 'currentFigure'. Error in matlab.gra​phics.inte​rnal.newpl​otwrapper (line 14) if isempty(currentFigure)

Asked by zin zin
on 11 Nov 2018 at 1:13
Latest activity Commented on by zin zin
on 11 Nov 2018 at 3:56
why i am taking this error? how can i fix it?

  1 Comment

In MATLAB CurrentFigure is a property you can get from the graphic root object but currentFigure is not the name of any Mathworks supplied routine.
If we had more context we might be able to figure out what should be used there.

Sign in to comment.

1 Answer

Answer by madhan ravi
on 11 Nov 2018 at 1:13
Edited by madhan ravi
on 11 Nov 2018 at 3:28
 Accepted Answer

g = groot; %edited after sir Walter's comment
isempty(g.Children) % True if there are no open graphics objects, false otherwise
%---------------------------
fig = get(groot,'CurrentFigure');
~isempty(fig)

  6 Comments

Sign in to comment.