Question about code generation.

조회 수: 2 (최근 30일)
Chan KitHoe
Chan KitHoe 2017년 9월 12일
댓글: Walter Roberson 2017년 9월 13일
Hi all, I am a new user of Matlab. (version R2016b) I have an algorithm that I wanted to convert to C language to accelerate the simulation time, and i have seen that the matlab coder can do that. So I installed the toolbox, but after trying to use it I realized that it generates .prj files. If that is the case, how can I use it on matlab? Is there a way to call the converted C code on Matlab? Thanks.

채택된 답변

Walter Roberson
Walter Roberson 2017년 9월 12일
The .prj files are files that describe which source files are to be included and how to compile them; the .prj files are not the executables. You need to tell it to generate the code.
  댓글 수: 3
Chan KitHoe
Chan KitHoe 2017년 9월 13일
What is the difference between a prj file and a mex file? Is the mex file another type of prj file that could be compiled in Matlab? Sorry for asking such a dumb question, I am new to this...
Walter Roberson
Walter Roberson 2017년 9월 13일
prj files are just files that say what is to be compiled and which tools to use to compile it. They are not source files and do not get compiled themselves.
The links I posted should walk you through the code generation process.
mex files are C or C++ or Fortran source code that can be compiled and linked for use with MATLAB. They are actual source files, not control files that say what should be compiled.
prj files are like the instructions on a Paint-by-Numbers set; mex files are like the paint. Instructions without paint do not get you anywhere. Paint without instructions might get you somewhere by themselves. But it is easier to have both together.

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

추가 답변 (0개)

카테고리

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