- The serial port is not properly created/ recognized by MATLAB.
- The serial port is being used by an other application outside of MATLAB.
- Verify that the serial (COM) port is listed in Windows Control Panel > Device Manager > Ports. You can also verify its availability using the following command:
- As you can create only one 'serialport' object for each port, make sure that a 'serialport' object using the same port number does not already exist in the workspace.
- Disconnect any devices / applications that might be using the serial port.
- Make sure that you have an updated Arduino driver on your device. If not, you can update the driver by following the workflow mentioned in the below link:
- If you still have issues with sending / receiving data, you might need to configure the communication parameters like BaudRate, DataBits, Party, StopBits, or Terminator to match with the connected device.
- Resolve Serial Port Connection Errors:
- Troubleshooting Serial Port Interface: