Can an end user without Matlab license use an executable containing the mex command?
7 次查看(过去 30 天)
显示 更早的评论
I have done a Matlab executable which uses the mex command:
eg. system('mex -v -g -LC:\Example\Release -lModel Test.c Test_wrapper.c')
I intend to use it as a standalone exe in a target computer which doesn't have Matlab.
I've installed the correspondent version of MCR in the target computer.
The .exe works fine on my computer, however, when I try to run it on the target computer from the command line, the following message pops up:
" 'mex' is not recognized as an internal or external command, operable programm or batch file "
Am I missing something here? Is it not possible to run a .exe containing Matlab commands on a target machine without Matlab?
On my computer i have:
- Matlab 2011b (32bit and 64bit, application is compiled using the 32bit)
- Visual Studio 2010 Ultimate
- Windows 7 (x64)
On target computer:
- Visual Studio 2010 Ultimate
- Windows XP (x64)
Any help will be highly appreciated! Thanks in advance!
采纳的回答
更多回答(2 个)
Walter Roberson
2012-9-24
If it will work at all (I do not know), then you have the issue that mex is installed as part of MATLAB, and is not part of MCR, so at the very least components of mex would need to be installed on the target machine.
Paul Metcalf
2012-9-25
A mex is used to accelerate a MATLAB operation. It can also be used in cases of parallel computing on the host. It's not designed to be a transportable application, though I can understand your confusion. To do what you are wanting, you need a license for MATLAB Compiler on the host. The targets then only need to install a license free MATLAB runtime called MCR. Be warned, MATLAB compiler is not one of the cheaper addons... Alternatively, since you are using MS Visual Studio, you could use MATLAB Coder, and export the source to MSVS, compiling there. In terms of licensing this will be cheaper. But you may find yourself hitting many walls with functions that are not yet supported in MATLAB Coder. I would therefore recommend the former in your case...
3 个评论
Paul Metcalf
2012-9-25
编辑:Paul Metcalf
2012-9-25
The OP'er appears to be trying to create a distributable exe from MATLAB using MATLAB toolbox functions. That will require MATLAB Compiler...
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!