Jerome Lecoq
Jerome Lecoq

Reputation: 43

Is it possible to execute compiled code both within and out of MATLAB environment?

Let me explain what I am trying to do. I have an application coded in Matlab and I would like to provide it to both Matlab users and non-Matlab users. So you would say : Just compiled it and deploy an executable. Fine.

But deployed application are somehow limited in what you can do (very importantly, you can't execute other M-file) so I would like to ALSO make it possible to Matlab users to start the deployed application from Within Matlab and provide these advanced capabilities for these guys. So Is it possible?

Of course, I could provide two versions : A .exe and .m but this is not really elegant and maybe there is a nice trick to do this. Any idea?

Upvotes: 3

Views: 419

Answers (2)

Andrey Rubshtein
Andrey Rubshtein

Reputation: 20915

You can use eval in deployed applications. You can also read .m files, since they are nothing but text. So, read the file, evaluate line by line, and there you go, you have an ability to use 3d party script .m files in your compiled Matlab program.

You will not be able to use functions in this way, only scripts.

The only thing I am not sure is whether it's legal. I can't guarantee that, you will have to contact Mathworks by yourself.

Upvotes: 1

Dhaivat Pandya
Dhaivat Pandya

Reputation: 6536

Matlab doesn't have inbuilt functionality to do this, and, detecting whether someone has Matlab installed or not varies greatly depending on operating system.

Upvotes: 0

Related Questions