Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Problem with C codes embeded in Matlab

조회 수: 1 (최근 30일)
Kelvin
Kelvin 2011년 3월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a Matlab file contain a thread 'mex -O SegSegForces.c'. Since there is a file with extension c so I wonder what should I do if I want to run this program? I have MicroSoft Visual Studio installed but I don't know whether this can help with the c program?

답변 (2개)

Jan
Jan 2011년 3월 16일
I suggest reading the documentation concerning the command MEX:
docsearch mex
If the C-function has been compiled by MEX, it can be called exactly as an M-function.

Kaustubha Govind
Kaustubha Govind 2011년 3월 16일
It appears that SegSegForces.c is a MEX-function. For the compilation command "mex -O SegSegForces.c" to work, you must first setup a MEX compiler using the command:
mex -setup
Then, on running the mex compilation command, you should see a binary called SegSegForces.mexw32 (or .mexw64 if you're on 64-bit Windows) generated. You can now call this function 'SegSegForces' like any other MATLAB function.
  댓글 수: 2
Kelvin
Kelvin 2011년 3월 16일
Thanks. But which compiler should I used? I have seen Lcc-win32 C (and others) in the list of options when I type mex -setup in the command window. The user manual of this set of program has mentioned gcc 3.3. Should I download and install it? My OS is Win XP.
Jan
Jan 2011년 3월 16일
You can try LCC, which is shipped with Matlab 32bit versions. The Visual Studio compiler are more powerful, therefore I suggest it, if you have installed it already. GCC is for Linux platforms.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by