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!
댓글 수: 1
채택된 답변
추가 답변 (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...
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!