Read line of ASCII string data from serial port
data = readline(device)
example
data = readline(device) reads data until the first occurrence of the terminator and returns data as a string. The function blocks MATLAB waits until the terminator is reached or a timeout occurs.
data
device
collapse all
Read a string of ASCII data from the serial port.
s = serialport("COM3",9600); configureTerminator(s,"CR"); data = readline(s);
serialport
Serial port, specified as a serialport object.
Example: serialport()
serialport()
ASCII data read, returned as a string. The terminator is not included.
configureTerminator
read
serialportlist