creating a dll from .m function and using it in matlab as shared librery

5 visualizaciones (últimos 30 días)
Hello , I am creating a matlab gui which activates a certain simulation. I am creating the gui , and another guy is creating the simulation itself as a single .m function. I have compiled the gui+simulation into an .exe and it all wokrs just fine. (the reason for the .exe is that the people who uses it , does not have matlab and I also dont want to give them our simulation source code). I would like to use my gui with several other simulations which fits the gui , which means that i would like to compile the simulation (.m function) as a dll and use that dll in my matlab gui which would be compiled to .exe. (the actual dll file that would be in the same directory as the exe file is the actual simulation that would be invoked.
I have tryed using the mcc but it just created a dll to use in c. So how can i do it?
Thanks Eran.

Respuestas (2)

Robert Cumming
Robert Cumming el 25 de Oct. de 2011
As I understnad it you cant compile a dll from matlab m code which matlab will be able to load.
i.e. m code -> dll -> load_into_matlab is not possible
  2 comentarios
eran
eran el 25 de Oct. de 2011
So are you familiar with another way of doing it?
I need to call to a matlab function from another matlab gui which was built into .exe file , and without exposing the sourcecode.
Thanks ,
Eran.
Robert Cumming
Robert Cumming el 25 de Oct. de 2011
if everything is compiled at the same time you can use native m or p-code. But if your exe is compiled before and you want to change the dll without re-issuing the exe you cant.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 25 de Oct. de 2011
If mcc created a dll for use in C, you could possibly call it from MATLAB using calllib()
  2 comentarios
Robert Cumming
Robert Cumming el 25 de Oct. de 2011
as far as I know calllib cannot load dll which originates from matlab code - its a restriction put inplace my TMW.
eran
eran el 25 de Oct. de 2011
I succeded in loading the dll but i couldnt make the function to work

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by