필터 지우기
필터 지우기

Matlab Coder: codegen command line vs gui. 100x slower. why?

조회 수: 3 (최근 30일)
Mat Fan
Mat Fan 2017년 10월 18일
댓글: Chris Volpe 2023년 8월 7일
Hello,
I am trying to figure out how to use go to command line and avoid the gui to generate a library (config:lib).
To do so through the gui, it takes a couple seconds.
To do so through command line: codegen('-config:lib', 'myfunction') takes several minutes.
Could anyone help me figure out the command line command used by the GUI that makes it so much faster?
thank you

답변 (1개)

Darshan Ramakant Bhat
Darshan Ramakant Bhat 2019년 9월 27일
MATLAB Compiler and MATLAB Coder are two separate products having different objectives.
As you have guessed correctly, MATLAB Compiler uses MATLAB Runtime and it is like executing the packaged code in MATLAB. There may not be significant runtime performance improvements.
However, MATLAB Coder generates C/C++ code from MATLAB code. This generated code can be used to build .exe or MEX files. Using MEX you can get significant runtime improvements since the execution happens with C/C++ code. You can refer to this example for more detail
  댓글 수: 1
Chris Volpe
Chris Volpe 2023년 8월 7일
It seems to me that the staff member who answered this question didn't understand the question. @Mat Fan did not ask about the Matlab compiler. This is strictly about Coder. He/She is saying that the Matlab Coder GUI, which is a front-end to the codegen command line tool, is much faster than using the codegen command line tool directly, which is very counter-intuitive.

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

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by