Undefined function or variable 'currentFigure'. Error in matlab.graphics.internal.newplotwrapper (line 14) if isempty(currentFigure)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
zin zin
am 11 Nov. 2018
Kommentiert: zin zin
am 2 Dez. 2018
why i am taking this error? how can i fix it?
3 Kommentare
Stephanie Stewart
am 2 Dez. 2018
p1=0;
p2=-2;
poles=[p1,p2];
num=[1];
den=poly(poles);
k=[0:0.01:10];
r=rlocus(num,den,k);
damp1= 0;
damp2=.45;
damp=[damp1,damp2];
om1=0;
om2=100;
om=[om1,om2];
grid on;
sgrid('new');
sgrid(damp, om);
grid on;
plot(r, '*');
I got the error when i tried to run this code. But i got the error in line 12.
this code worked 2 days ago...
now the plot function will not work
Akzeptierte Antwort
madhan ravi
am 11 Nov. 2018
Bearbeitet: madhan ravi
am 11 Nov. 2018
see https://www.mathworks.com/matlabcentral/answers/263788-how-to-detect-if-a-figure-exist#answer_206155 similar case
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!