Azzera filtri
Azzera filtri

Error with Screen function on .exe file

9 visualizzazioni (ultimi 30 giorni)
Jaime
Jaime il 21 Nov 2023
Commentato: Jaime il 23 Nov 2023
Hello, I am trying to execute a program made in an old version of Matlab(2019a), gstreamer 1.16 MSVC. This executable is actually from a study where they provide an OpenScience repository with the material, the study is titled "Is it impossible to obtain absolute pitch in adulthood" by Yetta Kwailing Wong... and the link to the repository: https://osf.io/tkrgb/files/osfstorage
Personally, when following the concise README file:
How to run the compiled program
  • Download and install Gstreamer 1.16 MSVC for Psychtoolbox Windows version
  • Download and install the complied program
  • Open the C: drive> Program Files or Program Files (x86) folder> APTraining5_v16>application
  • Right-click "APTraining5_v16" to open the contextual menu, and then click "Run as administrator"
I encounter an the error:
"Undefined function 'Screen' for arguments of type 'char'.
Error in => APTraining5_v16.m at line 1801."
Problem is that I don't know how to check inside the .exe file for this error, also that as it is from a considerably old version, I am unsure of what might cause it. In recent days I have tried differente ways to solve it but I always keep getting the same error message.
Any help would be greatly appreciated, also note that I'm new to Matlab (only heard of it last week in this study) so maybe I'm making a rookie error.

Risposta accettata

Walter Roberson
Walter Roberson il 22 Nov 2023
You are loading a pre-compiled executable that appears to have been built with MATLAB Compiler.
No .m files you add to your installation can affect the executable: MATLAB Compiler is specifically designed not to be able to run .m files other than the ones compiled into the executable.
So when the APTraining5_v16 executable was being built, who-ever built it did not have Psychtoolbox on their MATLAB path.
There are several possibilities here:
  1. You can go back to the people who built the executable and ask them to build it properly. Could be difficult if the organization does not exist or the principle people are no longer around
  2. You can hunt around for the source code, and if you find it, then built it properly yourself. Could be fairly difficult if the organization (etc)
  3. You can figure out how to break the security of Mathworks compiled executables, and add an appropriate module to the executable. It is know that this was possible around 2019, but very few people outside Mathworks have the tools to do that, and most of the people who do have the tools would refuse unless you had written permission from the copyright holders of the code.
  4. You could buy Mathworks. The entire company. And then use whatever tools they turn out to have. You would have to buy the entire company because the company policy is that they will refuse to help anyone break the security of their compiled executables. No-one knows how much it would cost to buy the entire company; the company is privately held, and there are no public valuations available for it. I would guess that if you offered $US 1 billion to be given to every Mathworks employee, that such a bid might be accepted... but I also guess that if you only offered $US 1 million to be given to every Mathworks employee, that they would consider you to be undervaluing the company.
  5. or... you could end up rewriting the code yourself based on the paper.

Più risposte (1)

Pratyush
Pratyush il 21 Nov 2023
Hi Jaime,
I understand that you are encountering an error related to the "Screen" function in the MATLAB code.
This error typically occurs when the "Psychtoolbox" functions are not properly installed or configured.
Here are couple of suggestions to troubleshoot the issue:
  • Ensure that Psychtoolbox is correctly installed and configured with MATLAB. You may need to reinstall or update the Psychtoolbox package to ensure compatibility with your MATLAB version (2019a).
  • Confirm that the version of Psychtoolbox you installed (Gstreamer 1.16 MSVC for Psychtoolbox Windows version) is compatible with MATLAB 2019a. Sometimes, older versions of packages may not be fully compatible with newer MATLAB versions, leading to errors.
  • Verify that the paths to the Psychtoolbox functions are correctly added to MATLAB's search path. This can be done using the "addpath" function in MATLAB.
You can refer to the following link to install and know more about psychtoolbox:
Hope this helps.
  1 Commento
Jaime
Jaime il 21 Nov 2023
Spostato: Walter Roberson il 22 Nov 2023
Hello, I appreciate the fast response.
Psychtoolbox seems correct, specifically the Screen function work fine, I checked Screen and ScreenTest without errors on Matlab.
I'm using Psychtoolbox 3.0.15 and g-streamer 1.16 MSVC wich I believe both are compatible with MATLAB 2019a and the Psychtoolbox functions are correctly added to MATLAB's search path.
So I find it hard to guess what I am doing wrong.

Accedi per commentare.

Prodotti


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by