use external Function in Gui

2 Ansichten (letzte 30 Tage)
Mehdi Golkar Amoli
Mehdi Golkar Amoli am 9 Okt. 2021
Kommentiert: Image Analyst am 10 Okt. 2021
Hello every one
I want to show one image on axes in the gui, but this imae is result of the external function in another .M file of matlab.
the problem is here, that external function show result as image in during its run, and gui also show this image on its background and in Continued execution gui gives an error that handles is define for axes is not valid!!
how can I use this external function on my gui structure?
I want to just get a matrix from external function and show that matrix on the axes of gui.
picture above shows my problem. now my programe before call axes handel shows the result of that external function on its the background. but I want thing like down picture
Thank you for helping me solve this problem.
I'm really confused!!

Antworten (1)

Image Analyst
Image Analyst am 9 Okt. 2021
Bearbeitet: Image Analyst am 9 Okt. 2021
You simply make your external code into a function and then call it.
One idea, it looks like your external function is calling subplot so it shows up on the GUI's figure. Have your external function call
figure
so that a new figure is created and the pictures will go there instead of on your main GUI window.
I can't really say more unless you attach your GUI program (.mlapp or .m and .fig files) and your external function/script.
  2 Kommentare
Mehdi Golkar Amoli
Mehdi Golkar Amoli am 10 Okt. 2021
Bearbeitet: Mehdi Golkar Amoli am 10 Okt. 2021
yes,I use a figure function in my external function
but my external code is more than 100 lines, and it is not very comfortable to define that on gui structure
acutally, is there no other way?
Image Analyst
Image Analyst am 10 Okt. 2021
OK, so your code has relatively few lines, but I don't know what "define that on gui structure" means. You need to decide whether the external function displays its stuff on a new, separate figure, or on your main GUI's figure window.
And did you see the last sentence of my Answer where I said
I can't really say more unless you attach your GUI program (.mlapp or .m and .fig files) and your external function/script.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Graphics Object Programming 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