I have 2 figures, one is a GUI with a tag figure1 and another Figure 1 opened seperately which is graph, I tried using gcf but it only recongizes the GUI (figure1). How do I get tthe other graph (Figure 1)?

답변 (1개)

Image Analyst
Image Analyst 2020년 8월 7일

0 개 추천

hFig1 = figure; % Create first figure.
hFig2 = figure; % Create second figure.
figure(hFig1); % Switch to first figure.
% Do stuff - plotting, etc.
figure(hFig2); % Switch to second figure.
% Do stuff - plotting, etc.

댓글 수: 3

Dinouk Goonewardena
Dinouk Goonewardena 2020년 8월 7일
편집: Walter Roberson 2020년 8월 7일
SavePlot_PP(handles) %This creates a plot 'Figure 1'
fig=gcf; % I want to get 'Figure 1' but it recongizes my GUI
%% is there a way to get my current figure as 'Figure 1'
Sudheer Bhimireddy
Sudheer Bhimireddy 2020년 8월 7일
Try creating a figure handle inside the SavePlot_PP() and return it.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

질문:

2020년 8월 7일

댓글:

2020년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by