Hello All,

I am trying to design a matlab program that can continuously update a horizontal bar graph as the user presses a certain key on the Cedrus box (RB-730).

I was able to get matlab to communicate with the response box using the code found in one of the earlier posts on using matlab with the response box. I was able to get a graph that updated too, but the graph does not update quickly enough when I press the keys at a fast rate.

My question:

Is it possible for the subject to continuously press and hold a key and can matlab keep updating the size of the bar as the key is pressed at a certain rate.

I have posted the code I’m currently using below. cedrusxid refers to the function from one of the previous posts on accessing the Response Box. Any suggestions are greatly appreciated.

Thanks,

Anil.

function [ output_args ] = test

%TEST Summary of this function goes here

% Detailed explanation goes here

maxscale = 55;

tension = 1;

barh([tension maxscale]);

drawnow;

x=0;

while x<100

y = cedrusxid;

if y == 80

tension = tension + 1;

end

```
if y == 112
tension = tension - 1;
end
if y == 48
x = 100;
end
barh([tension maxscale]);
drawnow;
x=x+1;
```

end