"Unrecognized method, property, or field 'Type' for class 'matlab.ui.control.WebComponent'."
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dave Watson
el 13 de Abr. de 2024
Comentada: Fangjun Jiang
el 16 de Abr. de 2024
In App Designer (MATLAB R2024a, Windows 10 Pro, 64-bit) I have a tab (app.tabFiles) that has a few ui components on it. When I query the Type property on all of them at once, I get the following error:
tf = strcmp({app.tabFiles.Children.Type}, 'uistatebutton') ; % This works fine with 7 other tabs, panels, etc
"Unrecognized method, property, or field 'Type' for class 'matlab.ui.control.WebComponent'."
However, if I query the Type of the components individually, each happily returns its Type. Huh?
I should mention, there are 13 components visible on the tab and 13 listed in the Component Browser. However, the tab has 14 Children - the extra child is the label (set to empty string) on a uieditfield component - but all respond as expected to the individual Type request.
Any idea what would cause that exception to be thrown? And how to avoid it?
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 14 de Abr. de 2024
Editada: Fangjun Jiang
el 14 de Abr. de 2024
I think app.tabFiles.Children is an array of handles. Try tf = strcmp(get(app.tabFiles.Children,'Type'), 'uistatebutton')
2 comentarios
Fangjun Jiang
el 16 de Abr. de 2024
close all;plot(1:3);
obj=findobj(0)
obj(1).Type
get(obj,'Type')
obj.Type
Más respuestas (0)
Ver también
Categorías
Más información sobre Install Products 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!