Matlab to C++ Converter??

조회 수: 4 (최근 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에서 Call C++ from MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by