use external Function in Gui

조회 수: 2 (최근 30일)
Mehdi Golkar Amoli
Mehdi Golkar Amoli 2021년 10월 9일
댓글: Image Analyst 2021년 10월 10일
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!!

답변 (1개)

Image Analyst
Image Analyst 2021년 10월 9일
편집: Image Analyst 2021년 10월 9일
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
Mehdi Golkar Amoli
Mehdi Golkar Amoli 2021년 10월 10일
편집: Mehdi Golkar Amoli 2021년 10월 10일
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 2021년 10월 10일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by