Error using AssertMex when running Screen.m

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) 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.

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

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

That makes sense thank yu for the explanation!