Azzera filtri
Azzera filtri

How to define a ButtonDownFcn function inside a GUI app ?

1 visualizzazione (ultimi 30 giorni)
Hello All,
I have a gui at which I am drawing an image, named 'im', inside a UIAxes object.
I am able to define the ButtonDownFcn property, called fcn, of im:
im = imagesc(app.UIAxes2,Plot_Entities.WK{1},Plot_Entities.WK{2},Plot_Entities.WK{3});
im.ButtonDownFcn = @fcn;
and it indeed calls it whenever I click on im. but I am getting an error saying the following (although i defined fcn inside the gui code):
(( Undefined function 'fcn' for input arguments of type 'matlab.graphics.primitive.Image'.
Error while evaluating Image ButtonDownFcn. ))
which is solved when I define fcn outside the gui app.
my question here: can I define fcn inside the code of GUI app itself ? or it should always be defined in the path ?

Risposte (0)

Categorie

Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by