Could someone please explain this code

This is a Matlab code I found for real time plot of Arduino output:

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

I don’t understand how x=[x,b] works. What happens to x through each iteration?

This is a simple concatenation of the existing list of readings x and the newly read value b, i.e. each iteration, the list grows by one element.

This is a Matlab code

Luckily someone here in the [u]Arduino[/u] forum seems to know what it does.