s = serial('COM1');
s.BaudRate = 9600;
s.Terminator = 'CR';
fopen(s);

read_data=[];

for i=1:10
 out = fscanf(s, '%d');
 read_data=[read_data out];
    assignin('base', 'read_data', read_data);
 %pause(.01);
end
 
fclose(s);
delete(s);
clear s;

figure(1);
plot(read_data);
