0

In PsychToolbox for MATLAB, I try to put

Screen('Preference', 'SyncTestSettings', maxStddev = 0.001, minSamples = 50, maxDeviation = 0.1, maxDuration = 5);

in the MATLAB command window, but it keeps to tell me:

Error in function Preference:   Extra input argument described
Error using Screen
Usage:
 
oldPreferenceValue = Screen('Preference', preferenceName,
[newPreferenceValue])

I was confused. The document given by PsychToolbox is:

[maxStddev, minSamples, maxDeviation, maxDuration] = Screen('Preference',
'SyncTestSettings' [, maxStddev=0.001 secs][, minSamples=50][,
maxDeviation=0.1][, maxDuration=5 secs]);

Is there anything I misunderstand the document? And what is the correct command?

(My MATLAB is R2021a, and PsychToolbox is 3.0.17.12)

user257122
  • 31
  • 4
  • This isn't valid MATLAB syntax, you can't have `=` statements in-line as function call arguments. I suspect the documentation is trying to articulate the order of the inputs and their default values, but the valid syntax is likely just providing the values in the right order. – Wolfie Sep 03 '21 at 09:19
  • @Wolfie, if I remember correctly from 2021 (a? b?) the name=value syntax is allowed in Matlab. – Matteo V Sep 03 '21 at 10:18

1 Answers1

0

What you are trying to accomplish can be done with the following command:

Screen('Preference', 'SyncTestSettings', 0.001, 50, 0.1, 5)

You have to provide these values in the correct order. If you wanted to skip over a value (i.e., leave it as is) then use

[]

like so:

Screen('Preference', 'SyncTestSettings', 0.001, [], 0.1, 5)