MATLAB Answers

Does MATLAB support USB communication?

56 views (last 30 days)
I would like to communicate with USB devices via a USB port. I would like to know if this is possible from MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Aug 2019
Edited: MathWorks Support Team on 21 Aug 2019
MATLAB does not provide a generic USB interface. Having an interface of this type would be in some ways like having a direct interface to either the PCI or ISA bus.
The Data Acquisition, Instrument Control, and Image Acquisition Toolboxes all support some USB devices. The list of supported hardware for each of these toolboxes is available respectively from:
For each of these USB devices, communication is handled by the driver of the device, and not by MATLAB. For example when using the National Instruments DAQPad-6024E, which is an external data acquisition device, the communications is handled entirely by the National Instruments NIDAQ driver.
One possible option is using virtual COM ports (over USB) with MATLAB serial. This can be possible only if there is a virtual COM port driver provided by the vendor.
Another option would be to create a MEX function that can communicate with a generic USB system driver. This function would serve as the glue between MATLAB and the device.
As of MATLAB 6.5 (R13) users have the ability to directly access any Dynamic Link Library (DLL) in Microsoft Windows. This functionality can be use to interface with a generic USB driver. For more information please consult the MATLAB Interface to Generic DLLs section of the documentation under the section titled "External Interfaces":


Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by