Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Converting Matlab .m file into C code
Date: Thu, 9 Oct 2008 13:53:22 +0000 (UTC)
Organization: Barron Associates
Lines: 14
Message-ID: <gcl2ci$oq$1@fred.mathworks.com>
References: <fgu4nb$6fe$1@fred.mathworks.com> <gc38je$oj6$1@fred.mathworks.com> <ApbFk.8020$i84.6499@newsfe10.iad> <gcgjtp$k1e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223560402 794 172.30.248.37 (9 Oct 2008 13:53:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Oct 2008 13:53:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 796958
Xref: news.mathworks.com comp.soft-sys.matlab:494338


For those of you who want to convert MATLAB to C, the fundamental question is:  Why?  What do you hope to gain?

If you answer that, someone can tell you the best way to proceed.

Once upon a midnight dreary, someone posted in this forum a link to a tool that converts MATLAB to C.  It is probably very expensive.

The MATLAB Compiler/Builder tools will generate a DLL that you can call from C/C++/C#/whatever.  You can write your application, and distribute it with the DLL and the MATLAB Compiler Runtime (MCR) (170+MB) so that your users can run your app without needing MATLAB.  The compiler can also generate an exe from your script, including a GUIDE script.

You can implement your MATLAB in a Simulink model (say an embedded MATLAB function block, which has some restrictions) and RealTime Workshop will generate C.

Walter covered all this, I know.  But he could answer you a lot better if you'd tell him *WHY* you want to convert to C.

reilly.