How to compile code for other Matlab users
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, Before embarking in any too difficult task, I would like to understand if it is possible to do the following thing: 1) compile a set of m-files user-created that also include calls to functions from some toolboxes (no particularly fancy things, maybe Java class included only) 2) use the compiled versions of the m-files on another computer that has Matlab installed but not necessarily the toolboxes 3) In practice, i want to use on the 2 machines the same way to call the functions i created, and normally use matlab on the second one.
The guide seems to suggest it is possible, but I cannot figure out the step by step approach. Any help is greatly appreciated. \Regards
Answers (3)
Kaustubha Govind
on 7 Apr 2011
0 votes
If you are calling into certain toolbox functions in your MATLAB scripts/functions, you need the same toolboxes installed on any other machine to be able to run your functions correctly. If these are third-party toolboxes not restricted by licensing considerations, you can always package your functions with the required toolbox directories and run them elsewhere.
Also, could you please clarify what you mean by "compiling"? Do you mean simply writing MATLAB functions/scripts or actually compiling MATLAB code into binaries using MATLAB Compiler?
Robert Cumming
on 7 Apr 2011
Do you want to protect your code from the other user editing? if so you have 2 options
1. Compile using matlab compiler
2. Pcode your m files.
each of these has issues (based on what you describe above)
1. If you compile a dll you cant load that back into Matlab (as far as I remember)
2. Your other computer will need the same toolboxes as you have for this to work.
If you can explain a bit more of what you want to do then it might be a bit more clear how to help you.
Matteo
on 11 Apr 2011
0 votes
2 Comments
Walter Roberson
on 11 Apr 2011
If you create a binary, then as far as I _know_ the destination machine does not need a license for the toolboxes you used. I could be wrong on that point.
Robert Cumming
on 11 Apr 2011
If you create an exe with the matlab compiler you are correct.
If you create a DLL however Mathworks does not allow a matlab created DLL to be loaded into Matlab (to stop users compiling up toolboxes to use as toolboxes)
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!