본문 바로가기
Programming/Matlab, Octave, Scilab

[Matlab] mex GUIDE

by 도파공 2010. 5. 1.
728x90
반응형

C/C++ 또는 Fortran의 소스 코드를 Matlab에서 사용가능하도록 해주는 것이 mex이다.

 

Matlab과 연동할 수 있는 컴파일러는 하기의 링크주소를 클릭하면 볼 수 있다.

Matlab 연동 컴파일러 목록

 

 

기본 설정은 Matlab에서

 

>>mex -setup

 

을 입력하고 엔터를 치면 된다.

 

Please choose your compiler for building external interface (MEX) files:
 
Would you like mex to locate installed compilers [y]/n?

n

 

이 목록에서

N

을 입력하고 엔터를 친다.

 

Select a compiler:
[1] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker)
[2] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker)
[3] Microsoft Visual C++ 2005 SP1
[4] Microsoft Visual C++ 2008 Express
[5] Microsoft Visual C++ 2008 SP1
 
[0] None
 
Compiler:

 

사용할 컴파일러의 번호를 입력하고 엔터를 치면 등록이 된다. 컴파일러 목록은 현재 사용하는 컴퓨터의 컴파일러 구성에 따라 달라질 수 있다.

 

기본적인 설명은 Mathworks사에서 제공하는 자료를 참고하면 된다.

mex guide : http://www.mathworks.com/support/tech-notes/1600/1605.html?BB=1

 

External Language Interfaces - MATLAB & Simulink

You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

www.mathworks.com

 

디버깅 방법은 아래의 링크주소에서 참고 바란다.

1. 윈도우즈 C Language

2. 윈도우즈 Fortarn Language

하드웨어 제어시 하드웨어 제조사에서 윈도우용 C/C++ 라이브러리가 제공된다면 위의 방법을 이용해서 Matlab으로 제어를 할 수 있다.

728x90
반응형

댓글