N-Back Array In-Line Code

Comments

1 comment

  • Avatar
    David McFarlane

    This code keeps track of the current and previous three stimuli, with a(0) holding the current value of the "Letter" attribute, etc.  It has to start from the end (a(3)) and work backwards for this to work.

    If you had to keep track of many more past trials then you would probably instead implement this with a For loop.  Alternatively, this could be implemented as a circular buffer, which takes a bit of finesse but can be more efficient.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk