Start Application from Matlab

Start application from Matlab

As I indicated in my Edit above, this could be a solution:

% Save library paths
MatlabPath = getenv('LD_LIBRARY_PATH');
% Make Matlab use system libraries
setenv('LD_LIBRARY_PATH',getenv('PATH'))
disp('Starting Blender...')
system( ['blender ', Directory, FileName, '.blend'] )
% Reassign old library paths
setenv('LD_LIBRARY_PATH',MatlabPath)

However, with the other way to start an application, you can immediately return to Matlab after starting it:

% Start Blender and immediately return to Matlab
!blender Geometry.blend &

The ampersand (&) is the key to immediately return to Matlab after starting the application , but starting Blender this way I cannot provide a variable FileName like I can do with system(...).

So, anybody got a clue on how to

  • use !program_name with a variable filename

    or

  • use system(program_name) with an option such that Matlab just starts the application (and doesn't wait with returning until the application has been closed)

build a standalone application from Matlab code

I think you're getting caught up on the attraction of the .exe file. If your goal is IP protection, then the .p code suffices. If your goal is to have a .exe file, then it's not simply IP protection.

Others have already stated that the documentation is simple and straightforward. Here is a very simple step-by-step example for creating a compiled example, using the Matlab compiler. Keep in mind you need to buy the compiler or at least use the trial version if you want to see how it is done.

Creating a standalone app from Matlab code

It's been a while since I looked at the MATLAB compiler but if I remember correctly it used to be able to generate C/C++ code rather than going all-out and generating an executable. The hangup was always in which toolboxes your code used and whether the compiler supported them or not. Any chance you could install the MATLAB application on a server and have a desktop client phone in for results?

As far as other languages go, I'd check out NumPy and SciPy in combination with matplotlib (matplotlib.sf.net). I'm working with a MATLAB developer right now and so far he's pretty pleased with the experience.



Related Topics



Leave a reply



Submit