Matlab Compiled Standalone App Very Large Size

Hi,
I recently wrote a small Matlab script which only uses a few GUI elements (made with GUIDE), file reading/saving and plotting.
When I compile it shows its size at 907mb, I'm sure that my tiny program (which just asks for a file selection, plots some data, then give the option to save the data) should probably not have a 907mb .exe
Looking around online hasn't helped much, does anybody here have any idea why it's so huge, and what I could do to fix it? As a test I made a new script which just has 'a = 1 + 2;' in it, compiling this takes up the same 907mb of space... so I'm sure I'm doing something wrong, I just don't know what.
Thanks,
Robert
EDIT: Ah, after reading a bit more I think I understand, so the MCR is ~907mb and is required for every standalone application? Time to brush up on my C++ I guess.

댓글 수: 1

Remember though that C++ does not in itself have any graphics facilities.

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

답변 (2개)

Walter Roberson
Walter Roberson 2016년 7월 8일

0 개 추천

You probably have the entire MATLAB Component Runtime embedded in your .exe . Doing that allows you to send the program to other people who do not already have MCR installed and they would not have to download MCR before running the program.
MATLAB is an interpreter, not a compiler. Essentially the entire MATLAB engine and libraries has to be stored in the .exe . MATLAB Compiler does not figure out which parts of the engine and library can be skipped for your particular application.
You should perhaps be considering MATLAB Coder and a third-party graphics library (coder does not handle graphics.)
Image Analyst
Image Analyst 2016년 7월 8일

0 개 추천

You do not need to include the entire MCR in your exe. I never do. Figure out where in your mcc code or deployment project you're doing that and turn it off. You can and should ship the MCR separately because they only need to install that once, but you might ship several versions of your code.

댓글 수: 2

JorgeJoe
JorgeJoe 2019년 11월 14일
So how can I do it? I use the deploytool and don't find any options of turning something off.
It doesn't look like you can have nothing bundled in, unless you use your own installer builder package. I use mcc and then use an excellent package called Centurion Setup to deploy my executable and all the various other files (documentation, templates, sample data, etc.)
It looks like the best you can do with MATLAB's deploytool is to check the "Runtime downloaded from web" radio button, and then it will add only a small 5 MB to your app.

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

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2016년 7월 8일

댓글:

2019년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by