i just want to transmit and receive data from a terminal on another for that i made a small code as follows
global gnCount
serial_comA = serial('COM10');
serial_comA.Baudrate=9600;
serial_comA.BytesAvailableFcnMode='Terminator';
fopen(serial_comA);
while(gnCount<10)
disp(gnCount)
serial_comA.BytesAvailableFcn=@fn_add_temp;
end
disp('finished')
fclose(serial_comA);
and am getting as output when i run it but i want to receive ata from another pc
and in line 4 gnCount is commented if i dont comment it am getting a continuous data which is assigned to gnCount and MATLAB is struck pls help me in this ASAS