how to rectify this
조회 수: 5 (최근 30일)
이전 댓글 표시
Dear sir
plot command not functioning for the simple cide
clc
clear all
t=0:0.1:2;
plot(t,sin(t))
showing errors as
Unrecognized function or variable
'currentFigure'.
Error in matlab.graphics.internal.newplotwrapper
(line 14)
if isempty(currentFigure)
Error in Untitled3 (line 4)
plot(t,sin(t))
pls suggest
댓글 수: 6
답변 (1개)
Animesh Gupta
2022년 5월 19일
Hello,
It is my understanding that plot function is not working in your case, and you are receiving the mentioned error.
clc
clear all
figure;
t=0:0.1:2;
g = groot;
fig = get(groot, 'CurrentFigure');
if ~isempty(fig) % true if there are no open graphics objects, false otherwise
% code to plot
plot(t,sin(t));
end
You can also refer the following link for more details -
I hope it helps.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!