Update History

Bug fixes and documentation revisions included in all updates.


  • Option to set drift/movement on any time-dependent path for any visual element using property position


  • Added element type noise for white Gaussian noise.
  • Added property noise to picture elements to apply noise using any of the options available in MATLAB imnoise.
  • Added record property frameRate to trial objects, recording instantaneous frame rate for all frames in a trial.


  • Added element type screenRecorder to record/capture displays to a single image file, sequence of multiple image files, or movie file


  • Option to set trial repetition and order directly in trial definitions with an optional trial run number input to addTrial, instead of using setTrialList
  • Option to save and reuse exact random scrambling patterns across bmlWalker elements


  • Round of bug fixes to functionality in MATLAB versions earlier than R2021a (down to R2017a): pb_install, pb_update, results csv file writing, pb_prefs
  • Minor additions/changes: catch scripts can now use properties changed or added in a script that halted on error (element type programming)


  • Added element type profiler. This runs the MATLAB code profiler for code debugging and assessment.


  • Results also write to a .csv file for analysis in apps other than MATLAB
  • Use a flag input to runExperiment to test the experiment by running it in auto-response mode to simulate a subject run unattended


  • mask property (a variant of crop) for picture and movie elements


  • A family of helper tools for working with strings/substrings (strcontains, strstarts, strends, and i variants)
  • keyPress elements now default to using Psychtoolbox KbCheck for responses, keyboard queue for triggers


  • All reference documentation (core and element types) is now online. Non-reference documentation remains in /docs but is also available online.
  • Revamp of MATLAB help: All documentation is now hyperlinked, including all function help text, Contents.m files summarizing files and folders, all options in pb_prefs, and the pb command menu. Added files summaries for /tools and /element type programming/basic. Now uses the standard MATLAB ver command for version information.
  • Compatibility options which are especially useful to avoid problems that Psychtoolbox experiences on Macs. See pb_prefs → screen tab → sync tests and compositor.
  • Save and resume any experiment run quit part-way through (type help runExperiment for details)
  • Any property that uses deg visual angle can also use px, wh (window height), ww (window width), or cm units using <cd>{value, <cd><cds>"unit"<cds><cd>}<cd> syntax
  • All visual element types now have all core visual options (rotation, opacity, convolution filter, etc.). (Previously some did not implement these options, e.g. line, linearDotMask, etc.)
  • Added intensity scaling as a core visual option
  • New input options to element_draw, _redraw for element type programmers
  • Minor additions/changes: Optionally use one number for symmetric dimensions in size properties across many element types (e.g. one number for a square side length as opposed to a rectangle). Added fit/fill/px sizing and crop options to element types picture and movie. Can set Gaussian convolution filter width. Can specify separable custom convolution kernels. And more.


  • Graphical interface for setting general preferences (default property values for trial, experiment, and device objects) using command pb_prefs. Especially useful for easily setting common parameters like Psychtoolbox sync tests; experiment window size; sound device, sample rate, and quality; etc.
  • Results output is now organized by object, not object class. More readable and each trial always uses one row.
  • Second results output now uses nan and <missing> values where possible to preserve numeric and string arrays for easier analysis
  • Option to set trial repetition and order directly in trial definitions using trial object property n. An alternative to the command setTrialList for unusual cases.
  • Added tools randomDistribute, randomDistributePerms for use in experiment scripts. Added an output to randomOrder to facilitating inverting order.
  • Added element type dotPath: arbitrary dot motion based on (x, y) time series data
  • Minor additions/changes: Default volume = on for movie elements


  • Sound input functionality using Psychtoolbox PortAudio, and element type soundRecorder to record sound to file
  • A sound-based Stroop demo where the subject responds verbally
  • Minor additions/changes: Set a break interval in a repeating display for element type bmlWalker


  • Added support for Cedrus response pads, and element type cedrusPress
  • Streamlined framework for devices (screen, PortAudio, keyboard queues, ports, button boxes, etc.) in element type code
  • Reduced start latency of keyPress, portSender, portReceiver, and other elements that use keyboard queues or ports


  • All response handler elements can now register triggers as well as record responses from subject, allowing you to use any response handler modality for triggers
  • Element type keyPress now uses a keyboard queue by default for better time measurement precision and never missing a key press. Polling functionality (Psychtoolbox KbCheck) is still available as an option.
  • Merged element type keyReceiver into keyPress
  • Add latency and buffer size properties to speaker device objects, which allows control over those technical settings in Psychtoolbox PortAudio. This is necessary to prevent crackling on some systems.
  • Added multisampling (general antialiasing) option to screen device objects


  • Added a second results output from runExperiment which contains results compressed into a numeric matrix or other arrays for extracting/plotting/analyzing with MATLAB functions. The first results output remains easily viewable as a table in MATLAB's visual variable editor.
  • Added an option in addTrial to define distinct trial groups by number, which can be useful in complex experiments
  • Stroop and biological motion demo experiments



  • Simplified the interface for setting timing from sync with a scanner or other external device
  • Minor additions/changes: Fast step sizes now default to regular step sizes for fixed step staircases


  • Can now use any static visual elements in pre-trial intervals, not just fixation crosses


  • Minor additions/changes: Can now load motion data directly from files for bmlWalker elements. Faster opening of bmlWalker elements when many there are many elements using the same motion data in an experiment.


  • PsychBench 1 beta