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 Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by