uigetfile takes ages when using appdesigner

Hi, not sure why, but its taking about 20s:
path='D:\temp';
try
[file,path]=uigetfile({'*.mat','Mat Files'},'Load Data',...
path);
catch
[file,path]=uigetfile({'*.mat','Mat Files'},'Load Data',...
'C:\');
end
openpath=fullfile(path,file);
%whos('-file',openpath)
load (openpath,'wv','sp','htext','colors');

回答 (1 件)

Raunak Gupta
Raunak Gupta 2020 年 2 月 18 日

0 投票

Hi,
From the profile viewer I can see that the self-time (actual time taken by the function without considering children function) is very less for uigetfile. Most of the time is taken by the FileOpenChooser.doShowDialog which essentially open the dialog box from which you may choose the file. Time taken by FileOpenChooser.doShowDialog essentially shows the time taken by the user to select the file. So, as I recreated the above situation, I found that the uigetfile is not running slow.

6 件のコメント

Jason
Jason 2020 年 2 月 18 日
編集済み: Jason 2020 年 2 月 18 日
Hi, so is this a bug or is there somethig I can do to fix it.
Just to add, the dialog didn't show until about 20s after requesting it.
Thanks
Raunak Gupta
Raunak Gupta 2020 年 2 月 18 日
Hi,
This is not a bug just if you can select the file faster, the processing will happen after that. Also the 20s that is mentioned is not captured by profile viewer so I guess some other processing must be happening in background in the app. I tried with the pushbutton UI and checked with the code provided above and it ran immediately (Only the selecting time was around 2-3 sec based on reaction to choose the file). Also It can depend upon the size of file you are trying to open in App Designer. If the pause is still present can you attach the .mlapp file and tell about the MATLAB release you are working with.
Jason
Jason 2020 年 2 月 20 日
編集済み: Jason 2020 年 2 月 20 日
Sorry, but the dialog didint show for about 20s, so the point about size of file ect. isn't relevant.
Raunak Gupta
Raunak Gupta 2020 年 2 月 20 日
Hi Jason,
Will it be possible for you to share the '.mlapp' file by attaching in a comment for me to recreate the issue with the information about which MATLAB Release you are working with.
Jason
Jason 2020 年 2 月 20 日
Hello, Im not able to see the same slow behaviour anymore and am not sure what I have done differently, so there's no benefit in sharing the mlapp file.
So I'm happy that this can be closed. However, I do have another issue that I have just posted regarding a time increase from GUIDE to APDESSIGNER that I would be happy to shar ethe file, please see
"Massive slow down in mouseclick behaviour in APPDESIGNER compared to GUIDE"
Thanks
Jason
Jason
Jason 2020 年 2 月 20 日
Im using 2019b

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

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

タグ

質問済み:

2020 年 2 月 13 日

コメント済み:

2020 年 2 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by