Help needed for using ccode() function

Hi, all I used Matlab to solve a LONG equation, and now I need to import it to C++.... I was able to make the equation to C++ compatible by using ccode() function.. But, the equation is too long that whenever I copy and paste it into my C++ compiler, the compiler just closes itself. (It's about 18 mb in size..LOL) I've tried ccode to make an 'optimized version' of the code, and now I ended up getting like 2,000 variables... Is there any helpful Matlab functions or option that I can use? Basically, I need to import an equation solved on Matlab to C++, and I need to simplify it into a reasonable length... Any help would be greatly appreciated Thanks, Steve

답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 24일

0 개 추천

Use the 'file' option of ccode to write the generated code to a file. Then you can #include the file or you can edit the result to add appropriate headers and so on.

카테고리

도움말 센터File Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

질문:

2012년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by