2012-10-11 2 views
2

그래서 Matlab 컴파일러를 사용하여 C DLL 형식으로 컴파일 된 m 파일이 있습니다. 컴파일 된 dll 파일은 원래 'matFunction.m'이라는 matlab 파일이었습니다. 이제 원합니다. MATLAB 코드에서이 DLL을 실행합니다. _i 다음matlab에 dll로 컴파일 된 m 파일 실행하기

loadlibrary compiledDLL.dll compiledDLL.h 
calllib('compiledDLL','matfunction') 

를하고있는 중이 야하지만 난 또한

loadlibrary compiledDLL.dll compiledDLL.h 
calllib('compiledDLL','matfunction.m') 

을 사용했다

Error using calllib 
Method not found 

하는 오류가 발생하고 있지만이 같은 오류를 얻고있다. 누군가가 내가 뭘 잘못하고, 내 matlab 코드에서이 DLL을 어떻게 실행 말해 줄 수 있습니다.

+1

을 LoadLibrary 함수, 그것은되지 않습니다 : calllib를 사용하는 경우

는 또한, 당신은뿐만 아니라 당신의 기능에 대한 적절한 인수를 전달해야합니다? 즉'loadlibrary (dll, hfile)'? 내가 틀릴 수도 있습니다 –

+0

http://www.mathworks.com/help/matlab/ref/loadlibrary.html –

답변

0

loadlibrary은 기능입니다. 적절한 구문은 documentation.

문서에 따라

loadlibrary(dll,hfile) 

가 명시 적으로 라이브러리가 이미 메모리에로드되는 경우 함수를 호출 할을 을하지 상태입니다.

tf = libisloaded(libname) 

을 사용하여 라이브러리가 이미 메모리에로드되었는지 테스트 할 수 있습니다.

[x1,...,xN] = calllib(libname,funcname,arg1,...,argN)