delete(instrfind(('Port'),('COM11')));
h=animatedline;
s=serial('COM11','Baudrate',9600,'DataBits',8);% sample rate is 9600/8.
fopen(s);
x=0;
while(x<10000)
    voltage=fscanf(s);
    y=str2double(voltage);
    addpoints(h,x,y);
    x=x+1;
    drawnow
end