findall doesn't find axes object

조회 수: 3 (최근 30일)
John F
John F 2022년 3월 21일
편집: John F 2022년 3월 21일
I have an app that creates a TabGroup and inside it some tabs that contain a plot. If the specific tab exists, I would like to plot on top of the existing plot. However, when using findall to find the axes that were created but I get a 0×0 empty GraphicsPlaceholder array. What am I missing?
tabs = get(TabGroup,'Children');
tab_names = arrayfun(@(tab) tab.Title,tabs,'UniformOutput',false);
if (~ismember('Station',tab_names))
station_tab = uitab(TabGroup,'Title','Station');
station_tab.Tag = "Station";
station_tab.AutoResizeChildren = 'off';
station_ax_Tt = subplot(2,1,1,'Parent',station_tab);
station_ax_Tt.Tag = "ax_Tt";
station_ax_Pt = subplot(2,1,2,'Parent',station_tab);
station_ax_Pt.Tag = "ax_Pt";
plot_stations(station_tab,station_ax_Tt,Tt,station_ax_Pt,Pt,Nm);
else
station_tab = findall(groot,'Tag',"Station");
station_ax_Tt = findall(groot,'Tag', "ax_Tt");
station_ax_Pt = findall(groot,'Tag', "ax_Pt");
plot_stations(station_tab,station_ax_Tt,Tt,station_ax_Pt,Pt,Nm);
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by