Matlab to C++ Converter??
조회 수: 4 (최근 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에서 Call C++ from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!