%% Flush Device Inputs and Outputs
% Create a connection to a serial port device using serialport. You can also connect to a Bluetooth device using bluetooth or a TCP/IP client using tcpclient.

dev = serialport("COM3",9600);

% Flush both the input and output buffers.

flush(dev);

% Copyright 2020 The MathWorks, Inc.