MATLAB Answers

Jackrecki
0

Matlab and USB2.0 Protocol data aquisition

Jackrecki
さんによって質問されました 2019 年 8 月 13 日
最新アクティビティ Kaashyap Pappu さんによって 回答されました 2019 年 8 月 16 日
Can i use Matlab to read Data that are incomming via an external device using the USB2.0 Protocol?
The Datarate ist appr. 5Mbit/s.
Thanks a lot. :)

  0 件のコメント

サインイン to comment.

1 件の回答

回答者: Kaashyap Pappu 2019 年 8 月 16 日

To read data from a USB, you can use the serial port object to initialize communication between device and MATLAB, followed by using fscanf or fread to acquire data from USB connected device. “fread” is ideal for binary data.
Note that for data acquisition, consider pre-allocating memory, otherwise it could slow down the read operation as an assignment like:
s = serial('COM1');
A = fscanf(s);
would reallocate memory for A each time fscanf is called. Specify appropriate the baud rate for the serial object.
Hope this helps.

  0 件のコメント

サインイン to comment.



Translated by