findobj not working with UIAxis
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have an app with tabs and Axis as Children.
When using
axesInTab = findobj(currentTab, 'Type', 'matlab.ui.control.UIAxes');
i get 0x0 GraphicsPlaceholder but when using
% Direktes Zugreifen auf Children-Eigenschaft
children = currentTab.Children;
% Filtern der Children, um nur UIAxes zu erhalten
axesInTab = children(arrayfun(@(c) isa(c, 'matlab.ui.control.UIAxes'), children));
I can find the Axis as expected.
Anybody has an idear? (Btw second Function is from ChatGBT lol)
0 comentarios
Respuestas (1)
Voss
el 7 de Feb. de 2024
The 'Type' and the class of something are two different things.
The value of the uiaxes 'Type' property is 'axes', so
axesInTab = findobj(currentTab, 'Type', 'axes');
will work.
The uiaxes is of class 'matlab.ui.control.UIAxes', so that's why isa(_,'matlab.ui.control.UIAxes') returns true for it.
0 comentarios
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!