Sampling frequency and interfacing with matlab

Hello everybody,
i'm trying to acquire data through arduino and plotting them with matlab. I need a sampling frequency of at least 1 kHz, but from tests made with a potentiometer it seems to be around 30Hz. Is it a matlab problem or an arduino problem? Which is the maximum sampling frequency of arduino? I have an arduino uno r3, and to interface it with matlab i've used the specific toolbox from mathworks. I attach the matlab code used for the acquisition:

passo=1;
interv=1000;
t=1;
x=0;
while(t<interv)
b=a.analogRead(0);
x=[x,b];
plot(x);
axis([0 interv 0 1023]);
grid
t=t+passo;
drawnow
end

I've also tried preallocating the array but strangely performance seems to go down.
Thanks for your help.

Are you using the Arduino Toolbox for Matlab?

Off of Arduino support for Matlab (Matlab website): "Run control loops at up to 25 Hz (not real time)"

Sorry, but you are limited...You could however write your own 'driver' for matlab (just use the serial protocol). I've gotten some good speeds when transfering small packets of data from Arduino to Matlab. This does require learning Matlab's serial() functions, but they aren't too hard.