Why can't i open uigetdir dialog box while run the program?

3 ビュー (過去 30 日間)
SEA-KEONG
SEA-KEONG 2014 年 4 月 21 日
コメント済み: Image Analyst 2014 年 4 月 22 日
When i place a break point on the line of function uigetdir(), i can open the dialog box when i step over (F10) the function line.
But if i remove the break point and run the program, the execution will pass the line of function uigetdir() and no dialog box shows up.
I wonder if i need to add uiwait() after that, but i don't know how to use it. If i directly add uiwait() after it, it will hold the whole program.
Thanks!

採用された回答

Image Analyst
Image Analyst 2014 年 4 月 22 日
You don't need uiwait() after the call to uigetdir(). Can you post a small snippet of the program to illustrate your problem. For example, this code definitely asks for the folder before it puts up the message box:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables.
workspace; % Make sure the workspace panel is showing.
folder = uigetdir();
msgbox('Done with demo');
  6 件のコメント
SEA-KEONG
SEA-KEONG 2014 年 4 月 22 日
so anyway i can let uigetdir() hang a little bit longer? Actually the hanging time is not that long... Thanks!
Image Analyst
Image Analyst 2014 年 4 月 22 日
I'm sure it doesn't take that long for you because you have access to that folder on your server. But the point is, I don't see any difference depending on if there is or is not a breakpoint. Either way it calls uigetdir() before it continues on.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by