You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
The matlab serial object can be used to connect to external devices that use serial communication, such as microcontrollers, GPS receivers, heartrate monitors, etc. In order to use a serial object, you need to know the serial port name.
GET_PORT_LIST returns a list of serial port names which are suitable for connections with serial port objects. The function is cross-platform (OS X, Linux, Windows) and does not require any Matlab toolboxes.
Example: (on OS X)
devices = get_port_list;
disp(devices)
'A700elGZ' '/dev/tty.usbserial-A700elGZ'
'PXFARNQU' '/dev/tty.usbserial-PXFARNQU'
Example: (on Windows)
devices = get_port_list;
disp(devices)
'6' 'COM6'
'1' 'COM1'
device_connection = serial(devices{1,2});
fopen(device_connection);
% send/receive data, etc
fclose(device_connection);
Cite As
M. A. Hopcroft (2026). Get Port List (https://se.mathworks.com/matlabcentral/fileexchange/56051-get-port-list), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.3.0.0 (2.79 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
