use external Function in Gui

2 visualizzazioni (ultimi 30 giorni)
Mehdi Golkar Amoli
Mehdi Golkar Amoli il 9 Ott 2021
Commentato: Image Analyst il 10 Ott 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!!

Risposte (1)

Image Analyst
Image Analyst il 9 Ott 2021
Modificato: Image Analyst il 9 Ott 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 Commenti
Mehdi Golkar Amoli
Mehdi Golkar Amoli il 10 Ott 2021
Modificato: Mehdi Golkar Amoli il 10 Ott 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 il 10 Ott 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.

Accedi per commentare.

Categorie

Scopri di più su Graphics Object Programming 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