I have an array of images in my GUI and each image have it's function, when it's clicked.
Can I call the function, when I don't specify it's name, but get the name from that array?
For example, I have variables row and coll, row = 1, coll = 2.
I would like to call function Image_2Clicked from knowing, that Image_2 is in row 1, colloumn 2.
Is there any way to do that?
Here is the array of Images:
Thanks in regards for help.
app.allimages = {app.Image app.Image_2 app.Image_3;
app.Image_4 app.Image_5 app.Image_6;
app.Image_7 app.Image_8 app.Image_9}

 Akzeptierte Antwort

Voss
Voss am 6 Mai 2022

0 Stimmen

app.allimages{row,coll}.ImageClickedFcn

2 Kommentare

Filip Konrady
Filip Konrady am 6 Mai 2022
Works perfectly, thank you very much! :)
Voss
Voss am 6 Mai 2022
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Display Image finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022a

Gefragt:

am 6 Mai 2022

Kommentiert:

am 6 Mai 2022

Community Treasure Hunt

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

Start Hunting!

Translated by