Matlab to C++ Converter??
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, may I know is there any build in converter inside Matlab R2010b? TQ...
0 Kommentare
Antworten (3)
Walter Roberson
am 24 Feb. 2012
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 Kommentare
Superb
am 24 Feb. 2012
10 Kommentare
Walter Roberson
am 26 Feb. 2012
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
am 26 Feb. 2012
7 Kommentare
Walter Roberson
am 28 Feb. 2012
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.
Siehe auch
Kategorien
Mehr zu Troubleshooting in MATLAB Compiler SDK finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!