Filter löschen
Filter löschen

findall doesn't find axes object

2 Ansichten (letzte 30 Tage)
John F
John F am 21 Mär. 2022
Bearbeitet: John F am 21 Mär. 2022
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

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by