clear all;
clc;

s = serial('COM1', 'DataBits', 8, 'BaudRate', 9600, 'Parity', 'None', 'StopBits', 1);
fopen(s)
frame = fscanf(s);

w = 60; h = 39;
lines = zeros(h, w);
for i = 1:h
    lines(i,:) = fscanf(s,'%i',w);
end

fclose(s);
delete(s);
clear s;

imshow(lines,[0 255])