MATLAB, Compiled MATLAB, Coder differences

조회 수: 2 (최근 30일)
Daniel Shub
Daniel Shub 2011년 11월 23일
답변: Chetan Rawal 2015년 6월 25일
Lets say I have a moderately complex calculation that is limited by the CPU, requires no "crap" (e.g., graphics, user input, symbolic math, and GPU processing) and is fully compliant with the limitations of the MATLAB compiler and the MATLAB coder. If I want to run this application on N machines (each with a license of MATLAB) do I run MATLAB, compile it and run the executable with MCR, or use the coder and run the executable?
My hunch is that the coder will produce slightly/significantly slower code, but then again, maybe the coder is really smart and it will produce faster code.
Maybe the questions are: If you have an abundance of MATLAB licenses is there any reason to use the compiler or coder? Are there disadvantages of using the compiler or coder?

채택된 답변

Walter Roberson
Walter Roberson 2011년 11월 23일
I flipped through the list of supported Coder functions, and it appeared to me that except perhaps for some boundary conditions, they were routines that could be relatively readily implemented using the standard C library. As the resulting C code would not require any interpreter level, I would expect that the C code would usually be faster.
I would not expect that the C code would always be faster, however: the trade-off of using the standard C library is that one would not be calling upon highly tuned cpu-specific math libraries such as LAPACK -- routines which are usually not invoked until the problem is "sufficiently big" (due to the overhead of marshaling the data from MATLAB storage in to the form expected by the routines).
  댓글 수: 1
Daniel Shub
Daniel Shub 2011년 11월 24일
I think I am going to have to play around with the coder. I am not sure it will provide me with any advantage; for me the bottle neck is thinking about the results I get from MATLAB and not getting the results. Still, it seems like a cool tool.

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

추가 답변 (1개)

Chetan Rawal
Chetan Rawal 2015년 6월 25일
An answer from the MathWorks Support team is now available to help you minimize the confusion. Go to the following page for the best guidance:

카테고리

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