MATLAB: Does the MEX function call in MATLAB 7.5 (R2007b) not work in newer MATLAB versions while passing a series of source files

inputMATLABmultipleonestring

I have created a MATLAB file that uses MEX as a function call to several flags and source files. This worked in MATLAB 7.5 (R2007b) but does not work in any of the new versions of MATLAB. For example, I have
source = ['file1' 'file2' 'file3']
And I want to pass it in a MEX command as follows:
mex(source,...)
However, I get an error about cannot find source.

Best Answer

The ability to pass a series of source files as a single string to the MEX function is not available in MATLAB 7.6+ (R2008a+).
In MATLAB 7.6+ (R2008a+) versions, the file checking routine is stricter. If a single string is passed in as an argument, it checks for a filename equivalent to the entire string and not as separate files. Therefore it is necessary to pass each filename as separate string instead of one.
Instead of
source = ['file1', 'file2', 'file3']
mex(source,..,..)
use
mex('file1','file2','file3',..,..)