PTB x MATLAB: screen error

Hi there!

I run a demo from Scarfe Lab: Scarfe Lab: Oval an got the following error:

Invalid MEX-file ‘C:\Users\Chiara Maria Mariani\AppData\Roaming\MathWorks\MATLAB
Add-Ons\Collections\Psychtoolbox-3\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\Screen.mexw64’: The
specified module could not be found.

Error in ShowCursor (line 190)
Screen(‘ShowCursorHelper’, screenid, type, mouseid);

Error in sca (line 26)
ShowCursor;

I’m using MATLAB R2024a, PyschToolBox-3, downloaded GStreamer (MSVC 64-bit (VS 2019, Release CRT Download GStreamer), Visual Studio 2022, and PTB (latest version 11th Aug 2024) from MATLAB Add-Ons Menu.
Due to the error I got, I tried to google it to find if anyone found a solution, but I didn’t really help.
What am I missing? Does anyone solve this issue?

I found that: Why do I receive an error: “Invalid MEX-file …mupadmex.mexw64: The specified module could not be found?” - MATLAB Answers - MATLAB Central (mathworks.com)
Then the next question would be how to disable anti-virus.

Thanks for your help!

My guess from the error message is that you have installed PTB using the Matlab “package manager” (I guess this because it is in the “MATLAB Add-Ons” folder). This is known to result in issues (see other threads on the forum for explanation) and is currently not supported due to these issues. If that guess is correct, the following should work.

(1) Remove/uninstall PTB via the Add On manager. Ensure that PTB does not show up on the Matlab path once you have done this. One would hope it would not, but it is worth checking.

(2) Install PTB from following the instructions here Psychtoolbox-3 - Download, Installation, and Update.

It should then work fine, including the demo you mention.

If it doesn’t my guess is incorrect.

P

1 Like

Re-reading your post I now see that you did install via Add Ons. Thus, I think my response is indeed correct. The fix instructions should therefore work.

P