MATLAB: Can *.mexw32 files be run with 64-bit version of 2013a

s-function file

I have a *.mexw32 file that runs on 32-bit version but not 64-bit version of 2013a. Can I just change the extension to .mexw64?
I get the following message on the 64-bit version: [Error in S-function 'Path': S-Function "Name" does not exist]. The file "Name" only exists in my files as Name.mexw32.

Best Answer

No, not a hope.
mexw32 files and mexw64 files are MS Windows .dll files with a different file extension (and particular routines expected to exist in them.) It is MS Windows itself that is not able to use a 32 bit DLL from inside a 64 bit program.
(This is such a common restriction in operating systems that I have never encountered an operating system that permitted 32 bit shared libraries to be called from 64 bit programs. The closest I have ever seen was that 32 bit MC68000-based programs call call upon 16 bit Z80 operating system calls in Cromemco Cromix computers in the early 1980s; that was handled by using a shared memory segment in way that would not be acceptable in any modern computer architecture.)