%% Set Same Terminator for Read and Write Communication
% 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("COM4",9600);

% Set both the read and write terminators to "CR/LF".

configureTerminator(dev,"CR/LF")

% Confirm the setting.

dev.Terminator

% Copyright 2020 The MathWorks, Inc.