Matlab to C++ Converter??

1 次查看(过去 30 天)
Superb
Superb 2012-2-24
编辑: Matt J 2013-10-25
Hi, may I know is there any build in converter inside Matlab R2010b? TQ...

回答(3 个)

Walter Roberson
Walter Roberson 2012-2-24
You can get the optional (costly) MATLAB Coder product.
There are a fair number of restrictions as to what can be converted. For example, no graphics.

Superb
Superb 2012-2-24
can that Matlab coder works on R2010b? TQ...
  10 个评论
Superb
Superb 2012-2-26
Thanks Walter...Can I use Visual Studio 2010 C++? How to connect VSC++ with MATLAB in this case?
TQ...
Walter Roberson
Walter Roberson 2012-2-26
You upgraded to R2011a ? If so then Yes, VS 2010 C++ can be used.
If you are using MATLAB in 64 bit mode then there is additional work involved; see http://www.mathworks.com/support/compilers/R2011a/win64.html

请先登录,再进行评论。


Superb
Superb 2012-2-26
Yes, I'm using R2011a from my Uni now...and I use a 32 bit Windows 7...I think it should work fine right? But how to connect them together? TQ...
  7 个评论
Superb
Superb 2012-2-28
I'm trying to convert into C++, but where can I choose to only convert to C++? It's because it only shows "C/C++" but not "C++", can I do that? TQ...
And u say, "if you are not writing your own processor kernel code.)", is that means if I convert directly using coder but not writing the whole code on my own? TQ again for explanation...
Walter Roberson
Walter Roberson 2012-2-28
I have gathered the impression that the code generated is in the common subset of C and C++, except that C++ style declarations might be used for external functions, extern "C" { .... } . There might be some other differences, perhaps; no one has happened to mention them in the messages I've read (the price of the toolkit is sufficiently high that there is no chance my workplace will buy it in the near future.)
If you did manage to find a way to generate C++ code, it still would not handle try/catch . C++'s exceptions are not the same thing.
My mention about writing processor kernel code has to do with the fact that the exception processing that _is_ possible in C, is of such limited flexibility, that nearly the only use for it (other than saying "I quit") is in embedded processing systems with paged memory, to detect a segmentation violation, swap in the appropriate page, and continue on. Not at all the kind of thing you are looking for.
It seems plausible to me that if you are using library routines that might produce meaningful exceptions for try/catch use, then _probably_ your code is not in the subset that can be compiled.
Verify your inputs before you send them to the lower levels so that you do not need to rely on try/catch.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by