How to control uigetfile GUI with matlab script ?

10 ビュー (過去 30 日間)
Wasawat Pengprakhon
Wasawat Pengprakhon 2022 年 7 月 4 日
コメント済み: Rik 2022 年 7 月 5 日
I have an internal matlab GUI tool (can only access tool and .fig) and my job is convert it into automated process.
I know how to control GUI with matlab script, but now I'm stuck with the button that call uigetfile() command in callback function (can't access any code because is in p-file).
I want to control the uigetfile window (fig 1) to change the directory and select the file with matlab script. I tried to pass the file name and file path as eventdata in callback function of the button but it didn't work.
fig 1 uigetfile window that i want to control it with matlab script.
How can I do it ? If it's impossible with matlab script, are there any ways to do it with others script such as batch and python ?
  3 件のコメント
Wasawat Pengprakhon
Wasawat Pengprakhon 2022 年 7 月 5 日
編集済み: Wasawat Pengprakhon 2022 年 7 月 5 日
Yes, uigetfile is called in p-function. Would you mind telling me more information or related link about "shadow uigetfile" that you mentioned ?
The method that I use now is use batch script to active the uigetfile window when it popup and send keys to it, then select file with TAB, ARROW and ENTER key. But this method is not much more practical than I expect and will pretty buggy if others programs run in parallel, so I'm still finding others ways to do it.
Rik
Rik 2022 年 7 月 5 日
What I mean is to create a function in your current folder with the name uigetfile. In that function you return the output the p function expects. You can use a persistent variable to queue up the output.
But I expect that p functions will use built-in functions, so this entire endeavor will be pointless. You can check by putting a msgbox in your uigetfile first, before writing the rest.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by