# draw a square?

**URL:** <https://psychtoolbox.discourse.group/t/draw-a-square/1507>\
**Category:** Uncategorized\
**Created:** [December 23, 2002, 4:45am UTC](https://psychtoolbox.discourse.group/t/draw-a-square/1507 "2002-12-23T04:45:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denispelli](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@denispelli](https://psychtoolbox.discourse.group/u/denispelli)\
**Post date:** [December 23, 2002, 4:45am UTC](https://psychtoolbox.discourse.group/t/draw-a-square/1507/1 "2002-12-23T04:45:33Z")

</div>

> \>Dear Dr. Pelli,  
> \>  
> \>My name is Bhargav Katikaneni and I'm a junior at Ossining High School  
> \>in Ossining, New York. I plan on conducting psychophysics research using  
> \>the Mat Lab(R12) with the psychophysics toolbox. In my experiments, I'm  
> \>using the recognition memory test in a visual working memory task. I   
> \>have various Mat Lab manuals, but I've been unable to find the Mat   
> \>Lab code to create 2d objects such as squares and rectangle. I would   
> \>like to present these shapes at timed intervals to test for accuracy   
> \>of subject responses. Can you help me with my problem? Thank you for   
> \>your help.  
> \>  
> \>Sincerely,  
> \>  
> \>Bhargav Katikaneni.  
> \>

dear Bhargav Katikaneni  
  
in the future please send your requests for assistance in programming   
to the forum. i support the psychtoolbox in my spare time, and all i   
have time for is development and maintenance.  
  
however, here's a minimal program to draw a square  
  
w=screen(0,'openwindow');  
black=blackindex(w);  
screen(w,'fillrect',black,[50 50 150 150]);  
getclicks; % wait until user clicks the mouse  
screen(w,'close');  
  
good luck in your project.  
  
best  
  
denis pelli
