# Error using AssertMex when running Screen.m

**URL:** <https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333>\
**Category:** Bugs & Features\
**Created:** [August 12, 2020, 7:27am UTC](https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333 "2020-08-12T07:27:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssbhamra](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ssbhamra](https://psychtoolbox.discourse.group/u/ssbhamra)\
**Post date:** [August 12, 2020, 7:27am UTC](https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333/1 "2020-08-12T07:27:10Z")

</div>

Hello,

I am running a 64 bit Windows OS on a Lenovo laptop with Windows 10. Running PTB 3.0.16 with Matlab R2019a.

I installed PsychToolbox following the instructions word for word ([http://psychtoolbox.org/download.html#Windows](http://psychtoolbox.org/download.html#Windows)) while selecting the complete installation of SubVersion and Gstreamer. Anyways I installed PTB (3.0.16) without any troubles.

When running Screen.m from the PsychBasic folder, I get the following error:

On Microsoft Windows with supported Matlab versions (\>= V7.4) it could also be that  
the required Visual C++ 2015-2019 runtime libraries are missing on your system.  
The Psychtoolbox/PsychContributed/ subfolder contains installer files for them, which  
you can execute after quitting Matlab. The name of the file is:  
vcredist\_x64\_2015-2019.exe and maybe also vcredist\_x64\_2010.exe.  
Error using AssertMex (line 190)  
Missing or dysfunctional Psychtoolbox Mex file for this operating system. Read the  
help text above carefully!!

Error in Screen (line 158)  
AssertMex(‘Screen.m’);

I’ve already tried quitting Matlab and clicking the files mentioned in the prompt (vcredist\_x64\_2015-2019.exe and vcredist\_x64\_2010.exe) and continue getting the same error. Not sure what else I should try as I haven’t been able to find any solid leads online.

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [August 12, 2020, 8:16am UTC](https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333/2 "2020-08-12T08:16:07Z")

</div>

When you say you have clicked the files, do you mean that you have installed both the vcredist\_x64\_2015-2019.exe and vcredist\_x64\_2010.exe packages? (are they in your list of installed programs on the computer?). If so, are you also sure you installed _exactly_ the right version of GStreamer (there is a direct link to it)?  
Do make sure you restart the computer after everything is installed.

Cheers,  
Dee

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [August 12, 2020, 1:24pm UTC](https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333/3 "2020-08-12T13:24:25Z")

</div>

If you call Screen while within the PsychBasic folder (which is a non-sensical place to be while running your own code or Psychtoolbox tests and demos), Matlab will find Screen.m and execute it, and this error message will be printed. That’s because Screen.m is a fallback file that is only to be executed if the real Screen mex file is missing or dysfunctional, so it can print troubleshooting instructions.

Iow. this is a false alert, only caused because you tried to call Screen while your current working directory is PsychBasic/. It should work while you are in any other sensible folder, where the correct Screen mex file would be found.

Hope it helps  
-mario

---

<div class="post-metadata">

**Author:** ![ssbhamra](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@ssbhamra](https://psychtoolbox.discourse.group/u/ssbhamra)\
**Post date:** [August 13, 2020, 11:21pm UTC](https://psychtoolbox.discourse.group/t/error-using-assertmex-when-running-screen-m/3333/4 "2020-08-13T23:21:02Z")

</div>

That makes sense thank yu for the explanation!
