I need to create a stand alone .exe file from a MATLAB code (with GUI) to work on all windows platforms (32 & 64 bits) while i have only 64 bit windows and 64 bit MATLAB software.

22 views (last 30 days)
Dear MATHWORKS Technical Support,
I've created a code and I would like to share it with my friends as a software only (not as a code). I can't install MCR on every and each PC. I need it to be portable so I can run this .exe file on any platform. Also I've compiled my code on my MATLAB 64 bit so it didn't work on 32 bit machines, so I need a way to compile the same code using the same 64bit MATLAB software on my PC.
  1 Comment
Titus Edelhofer
Titus Edelhofer on 3 Feb 2015
Note, that recent versions have incorporated the MCR download from MathWorks homepage in the package that you distribute. So when "installing" the package on your friends machine, it will look for the MCR and download and install it if not found.
Titus

Sign in to comment.

Answers (2)

Harsheel
Harsheel on 30 Jan 2015
  1. exe files created from 64-bit of MATLAB will run only on 64-bit Win.
  2. exe files created from 32-bit of MATLAB will run on 32-bit Win as well as 64-bit Win.
You need to install 32-bit version of MATLAB and recompile those files to create the 32-bit .exe file.
Note that if you don't use any MEX files (which are platform dependent) then, you can install the MATLAB Builder JA product to create .jar files. These files will be platform independent but of course your end users will have to write wrapper JAVA code to call the compiled .jar file. I'd go for the first workaround.
Disclaimer: I'm not from MathWorks Technical Support :)
  5 Comments
Rik
Rik on 14 Mar 2016
Generating C code seems to be impossible when talking about GUIs made in Matlab. The only way out seems to be to build a GUI in another language and converting the rest of your code to C to compile it independently (which the GUI then calls externally).
Please, someone tell me I'm wrong, because that would save me the trouble of learning another language to a sufficient degree to build a GUI.
Walter Roberson
Walter Roberson on 14 Mar 2016
MATLAB Coder will not generally generate any graphics. MATLAB Coder is limited to a subset of the C Standard Library, and that does not include any graphics at all. If it were extended to the C++ Standard Library the situation would not change, as that does not include any graphics either.
It would hypothetically be possible for Mathworks to generate to one of the graphics standards, but which one? OpenGL ? DirectX ? Carbon?

Sign in to comment.


Image Analyst
Image Analyst on 31 Jan 2015
Explain this requirement of yours in more detail: "I can't install MCR on every and each PC."
Bottom line: if you don't do that, then can't run on that computer, though they could use that computer as a "dumb terminal" to VNC into some other computer that you can install the MCR on.
  1 Comment
Ahmed
Ahmed on 3 Feb 2015
I actually don't want to install anything because it requires administrative access. That's why I'm trying to have my code to be a standalone file (as a portable software)

Sign in to comment.

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!