If you're using Matlab to connect to a remote device, like an Arduino or Cognex device, then you're probably using the TCP support of Matlab's Instrument Control Toolbox. Integrating Matlab with devices may be the first or only time you've written TCP code. This post will provide you with information on TCP and example Matlab code you can take and use—it's been tested on Matlab R2025a. After reading this, you'll be able to easily connect Matlab to devices over TCP sockets.