Description: SERIALDATASTREAM is a design pattern for a function to receive and process a continuous stream of data from a device connected to a USB or serial port. This function does not execute as written; it includes explanations and examples for all of the steps required to capture data which is transmitted continuously over a USB or serial interface. It uses some advanced features of the MATLAB serial port functions and has been successfully used for capturing data at rates up to 1.5 MB/sec. Examples for Windows, Mac OS X, and Linux are included. The MATLAB Instrument Control Toolbox is not required.
This code does not execute as it is written; it is a design pattern with explanations and examples in the comments. You can read it and modify it for your needs.