Matlab to C++ Converter??
1 次查看(过去 30 天)
显示 更早的评论
Hi, may I know is there any build in converter inside Matlab R2010b? TQ...
0 个评论
回答(3 个)
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.
0 个评论
Superb
2012-2-24
10 个评论
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
2012-2-26
7 个评论
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 Center 和 File 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!