Archive for the ‘Matlab’ Category

New, improved staircase procedure in the making

Saturday, October 18th, 2008

One of the reasons why people visit this website is my implementation of the Levitt 1971 adaptive staircase in Matlab. Apparently, there is a need for this kind of thing amongst researchers. That's why I've decided to reimplement the staircase procedure to include more functionality, such as:

  1. the ability to run multiple interleaved staircases
  2. more control of the stepsize

I'm still in the process of programming, debugging and testing the code at the moment, but here's a sneak peak of what is to come:

(click for larger image)

In the meantime, I've disabled the download for the old staircase procedure. If you want a copy, please drop me a line and I will send it to you asap.

Edit 06/02/2009: still in progress - please be patient

Reading files with headers into matlab

Wednesday, July 2nd, 2008

Here's a handy code sniplet that enables you to read a file with columns of data with headers into MATLAB:

  1. function importfile(filename)
  2.  
  3. % import the file
  4. newdata = importdata(filename);
  5.  
  6. % create new variables in the base workspace from these fields
  7. vars = fieldnames(newdata);
  8. for i=1:length(vars),
  9. assignin('base', vars{i}, newdata.(vars{i}));
  10. end

This will give you three variables in your workspace:

  • colheaders: a list of all the variable names, extracted from the header
  • data: a matrix with all your data in it
  • textdata: essentially the same thing as colheaders

A simple adaptive staircase toolbox for Matlab

Sunday, July 22nd, 2007

Today, I'm publishing a small toolbox for Matlab which enables you to run simple adaptive staircase procedures. Its theoretical basics can be found in Levitt's 1971 influential article titled "Transformed up-down methods in psychoacoustics". Its code flow is inspired on code previously written by Dirk Beer.

More information about the toolbox itself can be found on the project page.