Psychology 448A/538A

Advanced Programming for the Behavioral Sciences

Home Library of Functions Lessons Homework Discussion Board

Course Announcements:

5/4: Due to a glitch (mistake) that closed the catalyst submission time early for hw4, I'll let you submit 'getThreshold.m' any time before midnight tonight (Monday night).

5/3: NO CLASS NEXT WEEK (5/11 and 5/13). Please use this time to think about your course project.



Guthrie Hall, Room 055/057


Monday, Wednesday 2:30 - 4:20


Geoffrey Boynton


Guthrie 233A




Office Hours


Course Objectives

The objectives of this course are to learn how to use the programming language Matlab to develop, run and analyze data for experiments in the behavioral sciences. Through course lectures, homework assignments and a course project, students will become familiar with some of the more advanced tools that are available to generate stimuli, plot graphs, analyze data, and run simulations.Students are expected to have a background in computer programming, preferably Matlab, and should have access to a computer running the Matlab software. No special toolboxes are required except for the Psychophysics Toolbox, which is free 3rd party software. Instructions for downloading and installing the Psychophysics Toolbox can be obtained here.

This is the second quarter of a two-quarter sequence. The website from the first course,' MATLAB for the Behavioral Sciences: How to program your own experiment' can be obtained here. It is suggested that you review this course if you're rusty with Matlab.


Students will be evaluated through their performance on weekly homework assignments (65%) and through a course project due at the end of the academic quarter (35%).

Course Outline

Section 1 of this course will work through an experiment that measures
a subject's ability to see motion in noise.

Part 1 in this section will cover the basic techniques for showing
visual stimuli on a PC with Matlab using the 'psychophysical toolbox'.
This will include showing simple and efficient ways of producing fields
of moving dots using 'real world' coordinates.

Part 2 will cover methods for acquiring behavioral thresholds using the
stimuli developed in Part 1. We will discuss the 2 alternative
forced-choice method, various staircase methods, how to acquire
responses, provide feedback, and organize the behavioral data.

Part 3 will analyze the data acquired in Part 2 by fitting the
behavioral data with a template function using Matlab's optimization

Part 4 will focus on plotting the results, including using set and
get to manipulate figure attributes. The goal will be to produce
publishshable figures in Matlab without having to use additional

Section 2 will discuss more general modelling techniques.

Part 1 will provide insights into how to fit curves to data, including
tricks for developing quantitative models, and statistics for determining
which models fit best.

Part 2 will cover bootstrapping techniques for providing estimates of
variability for parameter estimates.

Section 3 will cover the fast Fourier Transfsorm (FFT).

Part 1 will cover the FFT for 1-dimensional data (e.g. time-courses)

Part 2 will cover the FFT for 2-dimensional data (images)

Section 4 will be all about Color, including color spaces, predicting
metameric color matches, and more.

Topics for the rest of the course are to be announced and will depend
upon the particular interests of the students in the class. Suggestions
are welcome!