Help: PTB 'DrawTexture' weird error

Hi everybody,


I am quite new to this and could need your expertise. I am trying to write an experiment, and so far it has shown on the screen what it needed to until it comes to loading in the pictures. I am using a script that has worked before, but no I get the following error, and I do not know why. Can someone please help?

Thank you!


Error in function DrawTexture: Missing argument
Discrepancy between a specified and supplied argument:
Specified Argument Description:
direction: Input
position: 2
presence:forbidden
formats allowed:
double
minimum M: 1
maximum M: 1
minimum N: 1
maximum N: 1
minimum P: 1
maximum P: 1
Provided Argument Description:
direction: Input
position: 2
presence: absent
Error using Screen
Usage:
Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode]
[, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);
Error in encoding_2 (line 219)

Screen('DrawTexture', win, tex(trial_order(trial+1))); %uses loadJPG_as_Texture.m



Are you sure that the line of code you posted at the bottom is the executed line? The error message tells you that the function is called with only one input argument, which doesn't match the code you show

On Sat, Sep 7, 2019 at 12:09 AM aleksandra.lecei@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


Hi everybody,


I am quite new to this and could need your expertise. I am trying to write an experiment, and so far it has shown on the screen what it needed to until it comes to loading in the pictures. I am using a script that has worked before, but no I get the following error, and I do not know why. Can someone please help?

Thank you!


Error in function DrawTexture: Missing argument
Discrepancy between a specified and supplied argument:
Specified Argument Description:
direction: Input
position: 2
presence:forbidden
formats allowed:
double
minimum M: 1
maximum M: 1
minimum N: 1
maximum N: 1
minimum P: 1
maximum P: 1
Provided Argument Description:
direction: Input
position: 2
presence: absent
Error using Screen
Usage:
Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode]
[, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);
Error in encoding_2 (line 219)

Screen('DrawTexture', win, tex(trial_order(trial+1))); %uses loadJPG_as_Texture.m





Hi,

Yes, that’s why I was confused, too. Funny enough, when I don’t run the script as a function (input only subjectID and run number) it works fine. With the exception that it only reads out 147 files but says there are 148…

Thank you

 

From: PSYCHTOOLBOX@yahoogroups.com <PSYCHTOOLBOX@yahoogroups.com>
Sent: zaterdag 7 september 2019 7:45
To: PSYCHTOOLBOX@yahoogroups.com
Subject: Re: [PSYCHTOOLBOX] Help: PTB 'DrawTexture' weird error

 

 

Are you sure that the line of code you posted at the bottom is the executed line? The error message tells you that the function is called with only one input argument, which doesn't match the code you show

 

On Sat, Sep 7, 2019 at 12:09 AM aleksandra.lecei@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

 

Hi everybody,

 

I am quite new to this and could need your expertise. I am trying to write an experiment, and so far it has shown on the screen what it needed to until it comes to loading in the pictures. I am using a script that has worked before, but no I get the following error, and I do not know why. Can someone please help?

Thank you!

 

Error in function DrawTexture: Missing argument

Discrepancy between a specified and supplied argument:

Specified Argument Description:

direction: Input

position: 2

presence:forbidden

formats allowed:

double

minimum M: 1

maximum M: 1

minimum N: 1

maximum N: 1

minimum P: 1

maximum P: 1

Provided Argument Description:

direction: Input

position: 2

presence: absent

Error using Screen

Usage:

Screen('DrawTexture', windowPointer, t exturePo inter [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode]

[, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);

Error in encoding_2 (line 219)

Screen('DrawTexture', win, tex(trial_order(trial+1))); %uses loadJPG_as_Texture.m