# PTB x MATLAB: screen error

**URL:** <https://psychtoolbox.discourse.group/t/ptb-x-matlab-screen-error/5470>\
**Category:** Programming Help\
**Tags:** windows\
**Created:** [September 5, 2024, 11:22am UTC](https://psychtoolbox.discourse.group/t/ptb-x-matlab-screen-error/5470 "2024-09-05T11:22:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiara](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chiara](https://psychtoolbox.discourse.group/u/chiara)\
**Post date:** [September 5, 2024, 11:22am UTC](https://psychtoolbox.discourse.group/t/ptb-x-matlab-screen-error/5470/1 "2024-09-05T11:22:36Z")

</div>

Hi there!

I run a demo from Scarfe Lab: [Scarfe Lab: Oval](https://www.peterscarfe.com/oval.html) 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](https://gstreamer.freedesktop.org/download/#windows)), 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)](https://it.mathworks.com/matlabcentral/answers/259229-why-do-i-receive-an-error-invalid-mex-file-mupadmex-mexw64-the-specified-module-could-not-be-f)  
Then the next question would be how to disable anti-virus.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![pscarfe](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pscarfe](https://psychtoolbox.discourse.group/u/pscarfe)\
**Post date:** [September 5, 2024, 2:04pm UTC](https://psychtoolbox.discourse.group/t/ptb-x-matlab-screen-error/5470/2 "2024-09-05T14:04:16Z")

</div>

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](http://psychtoolbox.org/download).

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

If it doesn’t my guess is incorrect.

P

---

<div class="post-metadata">

**Author:** ![pscarfe](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pscarfe](https://psychtoolbox.discourse.group/u/pscarfe)\
**Post date:** [September 5, 2024, 2:05pm UTC](https://psychtoolbox.discourse.group/t/ptb-x-matlab-screen-error/5470/3 "2024-09-05T14:05:53Z")

</div>

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
