필터 지우기
필터 지우기

Matlab GUI OPening Slowly

조회 수: 5 (최근 30일)
Jeena
Jeena 2014년 2월 21일
댓글: Image Analyst 2014년 2월 24일
Dear all,
I have an issue with my Matlab GUI I compiled with Matlab version R2013a. Once the executable is made by compiling the source code, it takes nearly 2 minutes to open the interface for the first time. From the next time onwards it takes around 30 - 40 sec to open the interface.
  • The executable formed after compiling is about 23Mb
  • The log file formed after compiling which shows the functions excluded is around 90Mb
  • I don't have any 'addpath', 'genpath' , 'uigetdir' functions in my code.
  • My main source code is nearly 254Kb and it calls some 30 other function files
  • I don't nothing in my OpeningFcn expect setting a single variable for version number
Once the GUI interface is opened it gives me correct answers as expected.
Any suggestion on what possibly can be the reason ??
Thanks,
Jeena

답변 (3개)

Image Analyst
Image Analyst 2014년 2월 21일
This is totally normal. Everyone complains about the time it takes to launch compiled apps, especially the first time. Join the club.

Walter Roberson
Walter Roberson 2014년 2월 21일
Compile a non-GUI program that just does something like display "hello world". Time how long it takes to start up. It will likely be not much different.

Jeena
Jeena 2014년 2월 24일
Hi all,
I found a potential place of error in my compilation.
I was using Matlab Compiler toolbox to compile the GUI applications. When I checked the settings of the building process, for some reason it was automatically adding all the available toolboxes in Matlab to the path of the application. This makes a 90Mb text file while shows the list of excluded functions. This also makes the size of my executable to nearly ~25Mb
I guess Matlab was trying to load many functions from the toolboxes when I was trying to execute my application. And this was taking too much time...
Now I removed the addition of all toolboxes except a toolbox which I need for plotting something in my application... This makes my application executable size come down to 5Mb and now I can open my application in less than 10 sec...
  댓글 수: 1
Image Analyst
Image Analyst 2014년 2월 24일
Does not make sense to me. I thought the MCR had all the functions you might need, whether you used them or not. I don't think the MCR has any toolbox functions built in, but I could be wrong. And your executable has instructions on what basic functions your app calls plus embeds toolbox functions that you own but are not in the MCR. When you run your app for the first time it unpacks a bunch of stuff from the CTF archive to a directory structure where you can see all the stuff it included, though this is usually in a fairly hidden folder. So I wouldn't think uninstalling unneeded toolboxes would make your app much smaller or faster.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by