-1

I recently have started learning how to code in matlab, i.e. programming simple experience for cognitive psychological investigations. I wanted to ask, whether someone knows both, how to define, where to draw a dot in the screen,and how to define the fixation time before the stimulus onset. I know, that the code for defining a dot position is the following:

dotXpos = [?] * screenXpixels;
dotYpos = [?] * screenYpixels; 

However, I don't know, which coordinates define the exact middle of the screen. Thank you in advance!

NKN
  • 6,482
  • 6
  • 36
  • 55
Lukas M.
  • 1
  • 1

1 Answers1

0

In Psychtoolbox, most of the fundamental drawing routines are provided through the Screen function. To draw a dot, you can use the DrawDots subcommand:

Screen('DrawDots', windowPtr, xy [,size] [,color] [,center] [,dot_type]);

Here, the xy should be the position of all the "centers" of the dots. For you it should be [dotXpos, dotYpos].

The center position of the screen is:

dotXpos = 0.5 * screenXpixels;
dotYpos = 0.5 * screenYpixels; 

To implement a timed delay before stimulus appears, you can use WaitSecs

Please check out:

https://web.archive.org/web/20160515043421/http://docs.psychtoolbox.org/DrawDots https://web.archive.org/web/20160419072932/http://docs.psychtoolbox.org/WaitSecs

Mingjing Zhang
  • 943
  • 5
  • 11