can't run MEX files on Matlab 7.10 (R2010a)

>> mex arrayProduct.c
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: 'arrayProduct.c' not found.
??? Error using ==> mex at 222 Unable to complete successfully.
>>

Answers (2)

The file arrayProduct.c is not in the current directory. You need to copy that file into the current directory, or change the current directory to the one where the file is located.
Assuming that you have already followed James' advice and are running the mex compilation command from the directory where the file exists and are still seeing the same error, there is a possibility that your system shell is configured to always start in a specific directory. To verify this, run the following commands in MATLAB when you are in the directory containing your file arrayProduct.c:
>> pwd
>> !cd
If the "!cd" returns a different value that "pwd", it means that your system command shell is configured to always start in the directory that "!cd" returns. You may want to change that. This is important because MATLAB redirects the "mex" command to the system shell using the ! operator or SYSTEM command, so the shell needs to be opened in the same directory in which MATLAB is operating.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Tags

Asked:

on 25 Jan 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!