1

I have an m file from which I use to create dll using the Matlab deploytool. the code simply reads as:

function hello 
disp('Hello')
end 

there are six functions in the compiled dll exported as:

uint8 helloInitialize
[uint8, voidPtr, voidPtr] helloInitializeWithHandlers(voidPtr, voidPtr)
helloPrintStackTrace
helloTerminate
uint8 mlfHello
[uint8, MATLAB arrayPtr, MATLAB arrayPtr] mlxHello(int32, MATLAB arrayPtr, int32, MATLAB arrayPtr)

Now I want to run this dll from my matlab command window using calllib and use the hello function. Assuming that I use the correct function mlfHello, calllib('hello','mlfHello') gives me nothing. Please advise me on what function to call and how to do it?

user3723486
  • 189
  • 1
  • 3
  • 12

1 Answers1

0

I'm not 100% its still the case but it certainly used to be that you couldn't load DLL's which were created in Matlab back into Matlab.

I suspect its still the case - so you cant do what your trying to do.

[edit] I dont have a link because they dont like to advertise the fact. The reason AFAIK is to avoid users compiling toolbox capability into DLL and giving to others to use in Matlab without a toolbox license.

matlabgui
  • 5,642
  • 1
  • 12
  • 15
  • I'm confused. why is that? any reference to documentation? – user3723486 Apr 04 '15 at 14:43
  • I just checked the library by `libisloaded` and it gives me that it is loaded? – user3723486 Apr 04 '15 at 14:50
  • That wouldn't surprise me as the DLL has to load for Matlab to check. As said I dont know if its the case in the latest version but it certainly was the case the llas time I tried/asked Mathworks (~2012b) – matlabgui Apr 04 '15 at 14:53