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.

2 次查看(过去 30 天)
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 个评论
Titus Edelhofer
Titus Edelhofer 2015-2-3
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

请先登录,再进行评论。

回答(2 个)

Harsheel
Harsheel 2015-1-30
  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 个评论
Rik
Rik 2016-3-14
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 2016-3-14
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?

请先登录,再进行评论。


Image Analyst
Image Analyst 2015-1-31
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 个评论
Ahmed
Ahmed 2015-2-3
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)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by