Brain Products on MATLAB® File Exchange
by Dr. Alex Kreilinger
Technical Product Manager (Brain Products)
MATLAB® has been an important tool to interface with Brain Products hardware and software for many years. In our articles, we often highlight how to use MATLAB® together with our solutions and provide example code via several different means. Sometimes you find the code in our support or newsletter articles, sometimes on bci.plus, and sometimes we just provide code to interested parties via our support channels. To make it easier for our customers, we have recently started to organize our code examples and provide everything in one central location: Brain Products’ MATLAB® File Exchange account.
MATLAB®-based client for the Remote Control Server 2 (RCS2)
The first examples you can find on the Brain Products hub is a MATLAB®-based client for the Remote Control Server 2 (RCS2). We have already introduced various clients for RCS here and, more recently, via PsychoPy here. However, we have never officially released a MATLAB® version. Now you can find the long-overdue code among the first uploads. With the MATLAB® RCS-client you can comfortably control complete recording sessions, from the start-up of BrainVision Recorder, setting up important configurations, initializing and completing monitoring and recording, up to closing Recorder at the end. Generally, we aimed to provide the code with enough documentation so that it is self-explanatory, but please do not hesitate to let us know if anything is unclear.
Remote Data Access (RDA)-client
The second example is an update of the Remote Data Access (RDA)-client. This new client is based on the tcpclient function that was introduced in MATLAB 2014b. We provide two examples: one to show the basic principle of how to connect to a data stream from BrainVision Recorder, and one to show a more elaborate way that includes averaging of EEG epochs based on incoming markers (e.g., ‘S 1’). Again, we aim to make the code self-explanatory, but at the same time, we only want to give you the basic tools that you can use to build your own functions.
Trigger markers and more
Finally, we took the opportunity to provide you with the code presented in the article “How to design trigger codes to obtain accurate markers” in the current newsletter. Please take a look at the extensive documentation in the code and the corresponding article.
As indicated above, this was just the beginning, and we plan to upload more code in the future. We will keep you updated about the progress in upcoming newsletter articles. If you have any questions regarding MATLAB® File Exchange in general, about the code in particular, or if you have ideas for potential MATLAB® code examples that we should include on our hub, please let us know.