Filter löschen
Filter löschen

How to define a ButtonDownFcn function inside a GUI app ?

4 Ansichten (letzte 30 Tage)
Ali Ghader
Ali Ghader am 24 Apr. 2018
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 ?

Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by