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

2 ビュー (過去 30 日間)
why i am taking this error? how can i fix it?
  3 件のコメント
Stephanie Stewart
Stephanie Stewart 2018 年 12 月 2 日
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
zin zin
zin zin 2018 年 12 月 2 日
are you getting the same error? like CurrentFigure error?

サインインしてコメントする。

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 11 日
編集済み: madhan ravi 2018 年 11 月 11 日
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 件のコメント

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by