필터 지우기
필터 지우기

How to generate c code from MATLAB code as subs is not supported by MATLAB.

조회 수: 2 (최근 30일)
Hi! I am facing some issues in generating C code from MATLAB coder while I used subs. Please help me to fix this so that I can generate the C code.

채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 12일
Nothing in Symbolic Toolbox can be compiled or code generated for.
What you need to do is go through all the formula generation ahead of time. You can then use matlabFunction() with the 'File' option to generate a .m file to implement your algorithm numerically.
If you need to create your formulas at run time, then you will need to find a different approach than using the symbolic toolbox; symbolic toolbox is only available for interactive use.
  댓글 수: 5
Walter Roberson
Walter Roberson 2018년 1월 12일
You will either need to program in all appropriate calculus yourself or else find a C or C++ library in which someone has already done the work.
Division and trig functions make the task notably more difficult than multinomials.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by