fixed indexing issue in readstudy.m introduced by last edit