Borrar filtros
Borrar filtros

Matlab App Designer get axes name from button click

5 visualizaciones (últimos 30 días)
Sankar Mahadevan
Sankar Mahadevan el 24 de En. de 2023
Editada: Chris el 24 de En. de 2023
Hello,
I have a matlab app with over 20 UIAxes. I want to mouse click on a particular axes (e.g. app.UIAxes2). Once I do that I want gca to return the title of UIAxes2. Is this possible.
essentially when I mouse click the UIAxes, I want gca to return the handle of that particular UIaxes. Can someone help me out?

Respuestas (1)

Chris
Chris el 24 de En. de 2023
Editada: Chris el 24 de En. de 2023
I would add a tag (under "Identifiers") to the UIAxes. Then:
function UIAxesSelectedCallback(app, event)
selectedAxes = event.Source.Tag;
end
If you just want a handle to the axes, that's as simple as
function UIAxesSelectedCallback(app, event)
thisHandle = event.Source;
end

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by