Flush serial port buffers
flush(device)
flush(device,"input")
flush(device,"output")
example
flush(device) flushes all data from both the input and output buffers of the specified serial port.
device
flush(device,"input") flushes only the input buffer of the specified serial port.
flush(device,"output") flushes only the output buffer of the specified serial port.
collapse all
Use the default to flush both serial port buffers.
s = serialport("COM3",9600); ⋮ flush(s);
serialport
Serial port, specified as a serialport object.
Example: serialport()
serialport()
getpinstatus
read
write