I have compiled Mex file successfully on my laptop. But when I am running it, it says Invalid mex file \'c:\\newfolder\\filename.mexw32\' The specified module could no
This MathWorks support link suggests two possible reasons to your problem:
Either way, to locate the source of this error it says that you need to list all dependent library files and verify their existence in the system you're trying to run the MEX file on, and also recommends the Dependecy Walker as the tool to to do that.