Effacer les filtres
Effacer les filtres

findall doesn't find axes object

2 vues (au cours des 30 derniers jours)
John F
John F le 21 Mar 2022
Modifié(e) : John F le 21 Mar 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

Réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by