Fix invalid MEX-file error for Psychtoolbox in 1 minute

Invalid MEX-file 'MEX-file name': The specified module could not be found.

In short: run the following command in your Matlab

KbCheck(-1)

The INFO will check your dependencies and tell you what to do. In my case it told me to copy a .dll file from where you install Psychtoolbox to C:\Windows\System32, then problem solved.

Hope this solution works for you. It works for me and it’s a life-saver.

Leave a Reply