# randomizing the presentation of 2 stimuli in each trial

**URL:** <https://psychtoolbox.discourse.group/t/randomizing-the-presentation-of-2-stimuli-in-each-trial/416>\
**Category:** Uncategorized\
**Created:** [September 5, 2012, 1:27pm UTC](https://psychtoolbox.discourse.group/t/randomizing-the-presentation-of-2-stimuli-in-each-trial/416 "2012-09-05T13:27:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [September 5, 2012, 1:27pm UTC](https://psychtoolbox.discourse.group/t/randomizing-the-presentation-of-2-stimuli-in-each-trial/416/1 "2012-09-05T13:27:46Z")

</div>

Hello,  
  
I am really new to psychtoolbox. I am trying to write a script for my experiment. I would like to show 2 stimuli in each trial in which one of the stimuli is fixed like a pen and the other one is a randomized one from a set of images that I have. I would like to show the 2 stimuli in each trial as random meaning I don't want to always show the pen as a first stimuli. My question is how can I randomize the two stimuli so that sometimes the pen is shown as first and other times as second stimulus in each trial?  
  
Thank you,  
Armita

---

<div class="post-metadata">

**Author:** ![peter.scarfe](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@peter.scarfe](https://psychtoolbox.discourse.group/u/peter.scarfe)\
**Post date:** [September 5, 2012, 3:04pm UTC](https://psychtoolbox.discourse.group/t/randomizing-the-presentation-of-2-stimuli-in-each-trial/416/2 "2012-09-05T15:04:53Z")

</div>

Sounds like you might be stuck with basic Matlab issues.   
  
Google for Matlab tutorial or Psychtoolbox tutorial.  
  
e.g.  
  
[http://argentum.ucbso.berkeley.edu/PTBtutorial](http://argentum.ucbso.berkeley.edu/PTBtutorial)  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "azalea\_blooming" \<azalea\_blooming@...\> wrote:  
> \>  
> \> Hello,  
> \>   
> \> I am really new to psychtoolbox. I am trying to write a script for my experiment. I would like to show 2 stimuli in each trial in which one of the stimuli is fixed like a pen and the other one is a randomized one from a set of images that I have. I would like to show the 2 stimuli in each trial as random meaning I don't want to always show the pen as a first stimuli. My question is how can I randomize the two stimuli so that sometimes the pen is shown as first and other times as second stimulus in each trial?  
> \>   
> \> Thank you,  
> \> Armita  
> \>
