user3248216
user3248216

Reputation: 17

Is there a way to create .exe file for a .m file in matlab without mcr?

I am having a matlab(.m) file and corresponding gui(.fig) file. Now I want to generate (.exe) file i.e, a standalone application that works on pc's where matlab is not installed. Can I do this without adding mcr(matlab compiler runtime)? Because mcr is itself of 400MB data.

Upvotes: 1

Views: 2020

Answers (2)

Sam Roberts
Sam Roberts

Reputation: 24127

As @Lokesh answered, it's possible to generate C code from a subset of the MATLAB language using MATLAB Coder, and compile this to an executable. Unfortunately, that subset does not include GUI-building functionality, so it won't work in your case.

If instead you are creating an executable using MATLAB Compiler, then the end-user must install the MCR to be able to run your application.

However, you don't have to package the MCR within your executable - it can be delivered separately, keeping the size of the executable itself pretty small.

If you are using MATLAB version R2011b or earlier, you must supply the MCR to your end-user. However, since R2012a, the MCR has been downloadable from MathWorks, so you can just send your end-user the small executable, and ask them to download the MCR themselves.

Upvotes: 1

Lokesh A. R.
Lokesh A. R.

Reputation: 2366

Yes there is. You need to MATLAB Coder to create an executable.

Downside - You cannot create the exe file with the GUIs you have built.

Upvotes: 3

Related Questions