The following guide describes how MATLAB works with EMOTIV LSL Interface.
- Install MATLAB (recommend version 2017a or later)
- Get MATLAB LSL library from https://github.com/labstreaminglayer/liblsl-Matlab.git. Currently, we are using version at commit "62761b0". You also can get the library via submodule command as below
git submodule update --init
-
Go to Lab Streaming Layer page, Outlet tab in EmotivPRO, choose the desire Data stream type and Data format. Click the Start button to start streaming.
-
Open vis_stream.m in MATLAB.
-
Run vis_stream.m. In the pop-up dialog, change the sampling rate for display to match the rate of data from the Outlet:
- Hit Ok. The data stream will be displayed like this:
Note: You also can retrieve data via RecieveData.m example.
- Open sendmarker.m in MATLAB. The program will create a marker event every second.
- The marker event is a vector containing
MarkerTime
,MarkerValue
andCurrentTime
. - The
MarkerTime
andCurrentTime
are epoch time in double format - we need both for the time synchornization between machines. - The
MarkerTime
is time of marker event. TheMarkerValue
is value of marker.The CurrentTime
is current epoch time of processing.
-
Run sendmarker.m.
-
Go to Lab Streaming Layer page, Inlet tab on EmotivPRO, choose MatlabMarker in stream name. Then click the Connect button.
- Markers will be added to data stream as the vertical red lines: