# Presenting stimuli at different locations

**URL:** <https://psychtoolbox.discourse.group/t/presenting-stimuli-at-different-locations/2030>\
**Category:** Uncategorized\
**Created:** [July 15, 2013, 3:27pm UTC](https://psychtoolbox.discourse.group/t/presenting-stimuli-at-different-locations/2030 "2013-07-15T15:27:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wallace.david92](https://avatars.discourse-cdn.com/v4/letter/w/7ea924/32.png) [@wallace.david92](https://psychtoolbox.discourse.group/u/wallace.david92)\
**Post date:** [July 15, 2013, 3:27pm UTC](https://psychtoolbox.discourse.group/t/presenting-stimuli-at-different-locations/2030/1 "2013-07-15T15:27:50Z")

</div>

Hi everyone,  
  
I'm relatively new to Matlab, I've used NBS Presentation previously which is alot simple in terms of coding.  
  
So I've made a script where 2 stimuli are shown in succession. The first stimulus (A) is shown at the centre of the screen, whereas the successive stimulus (B) must be shown off-centre, either to the left, right, top or bottom of the centre of the screen.  
  
I'm familiar with the rect function of psychtoolbox, but wasn't sure how to present stimulus B in either of those positions (in a random order across trials).  
  
I've considered making a function where if t=a certain number, then rect = certain position, would this be a logical option?  
If anyone could point me in the right direction that would be great and save me alot of MATLAB frustration.  
  
Thanks in advance,  
Dave.
