Creating two figures in your guide

How can I create a gui that takes an image as an input in figure 1 and displays it as an output in figure 2 after magnification

2 件のコメント

Rik
Rik 2021 年 2 月 16 日
GUIDE can't do multiple windows. Luckily you can use other tools.
Paul Juma
Paul Juma 2021 年 2 月 16 日
And how can you link two guides

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 2 月 16 日

0 投票

Technically Yes, but in practice... not so nice.
GUIDE cannot be used to build two simultaneous interfaces: you cannot directly split an interface across two windows. You cannot, for example, use it to (directly) create a file selection interface, and have it control a separate figure that has plotting controls.
It is possible to program a callback in one GUIDE GUI to call an external function that just happens to be a second, separately manged, GUIDE GUI. However, sharing data and control between the two is a bit tricky, and control and your code is likely to get confused if you happen to have the same object 'tag' in two different interfaces. It is possible to specifically restrict a search to a particular object to one particular figure, but a lot of the time that does not get programmed in.
The "obvious" approach to want to take would be to store data in the handles structure, invoke the second GUIDE gui, and have it pull the needed information from the handles structure. However, it turns out that each GUIDE GUI has its own handles structure, that are not shared between GUIs, making it necessary to take the time to deliberately coordinate between them. It is possible (I have done it), but you have to know what you are doing.
Instead of trying to coordinate between two different GUIDE GUIs, it is possible to use GUIDE to lay out the main GUI, and then to have code that calls appropriate functions to create a second figure and populates it with controls and configures its callbacks. But you have to be careful: when I said earlier that handles structure is not shared between GUIs, what I was really saying is that handles structure is not shared between figures, so callbacks for controls on the second figure do not get the same handles structure as callbacks for the first GUI. You can work around-these things, but you have to be conscious of what you are doing.
It is not uncommon that by the time you are comfortable deliberately coordinating the action between multiple live figures, that you just give up and go ahead and build the GUIs entirely in code without using GUIDE (at least not for anything more than "storyboarding" to see how the various graphics elements look next to each other.)

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

質問済み:

2021 年 2 月 16 日

回答済み:

2021 年 2 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by