Problems Compiling Matlab Code into Standalone

Complete Compiling-Newbie here... I have a MATLAB code that I would like to be able to run on computers w/o MATLAB. Unfortunately, using mcc -m Mycode.m doesn't seem to produce a stand alone program... Any ideas or help?

 採用された回答

Titus Edelhofer
Titus Edelhofer 2011 年 11 月 23 日

0 投票

Hi,
some things to check:
  • I guess the compiler is installed, otherwise you would have got an error "unknown function mcc".
  • Has the compiler been set up? Run "mbuild -setup" to be sure.
  • Run "mcc -v -m Mycode". Does it produce warnings/errors that might help diagnose?
Titus

9 件のコメント

John Ogren
John Ogren 2011 年 11 月 23 日
Hi Titus,
I ran "mbuild -setup" and the result that I it ran fine. It was successful in updating my options file.
I also ran "mcc -v -m Mycode" and I got an error. Before the error MATLAB output: "Compiler version: 4.11 (R2009b)". The error was:
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
As before, I am still in the dark... maybe this helps you!
Thanks again.
Kaustubha Govind
Kaustubha Govind 2011 年 11 月 23 日
John: Is that the complete output that you need? No additional error information?
John Ogren
John Ogren 2011 年 11 月 23 日
Kaustubha: What I put in my above comment was the only error that I received... any thoughts?
Titus Edelhofer
Titus Edelhofer 2011 年 11 月 23 日
John, you are in the folder, where Mycode.m is? I.e., "dir Mycode.m" gives a result?
Image Analyst
Image Analyst 2011 年 11 月 23 日
Can you try it with a simpler program, for example one that has only one line that says m=10; ?
Image Analyst
Image Analyst 2011 年 11 月 23 日
Maybe you can try to compile from the deploytool instead of the command line.
John Ogren
John Ogren 2011 年 11 月 23 日
So the first issue that I had was Matlab could not compile my code because I already had a version compiled into that directory. When I removed the old version and reran "mcc -m -v Mycode" everything worked fine. I have a code that runs... but how do I get it to run on computers that don't have Matlab? Also, when I run the code, it does not exit the "Matlab Environment"... That is, I have a blinking cursor but I can't type anything in the command line. Anyone know how to get back to the command line?
Daniel Shub
Daniel Shub 2011 年 11 月 23 日
These are really new questions. You need to install and extract the MCR on the other computers (they need to be running the same OS as the compiled version). The last line of your code needs to be quit, or a little less frustrating
if isdeployed, quit, end
John Ogren
John Ogren 2011 年 11 月 23 日
Daniel: I wrote these up as new questions... What I am looking for is a way to run my programs without having to install MCR on other machines. Ideas?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by