How to import and plot EEG data in EEG lab/BCI lab?
19 views (last 30 days)
Show older comments
I am new to EEG lab. Basically i have a EEG data in the form of a Matlab array like (59x200x200) = (channels x trials x values) sampled at 100Hz. I want to import it in EEGlab to see a plot of the data in time and frequency domain. when i import the data and plot it i recieve the plot given in figure attached. I am unable to understand why does time have 2000 values in each trial when it should have been 200.
![import](https://www.mathworks.com/matlabcentral/answers/uploaded_files/988275/import.png)
![plot](https://www.mathworks.com/matlabcentral/answers/uploaded_files/988280/plot.png)
0 Comments
Answers (1)
Vatsal
on 25 Jan 2024
Hi Adnan,
In EEGLAB, the expected data format is "channels × values × trials", so before importing your data into EEGLAB, it is necessary to transpose the third dimension (values) to the second dimension (trials) to match the EEGLAB format. This can be achieved by using the “permute” function in MATLAB.
In an EEG plot, the horizontal axis typically represents time. Given a sampling rate of 100 Hz, this means there are 100 values per second. So, for 200 values, the time span would indeed be 2 seconds (2000 Milliseconds).
On the horizontal axis of the EEG plot, the 200 values represent the time course of a single trial, which spans 2 seconds (2000 Milliseconds). The trial on the axis would typically start at 0 seconds and end at 2 seconds (2000 Milliseconds), with each value corresponding to a specific point in time within that window. So, the first value is at 0 seconds, the 100th value is at 1 second (1000 milliseconds), and the 200th value is at 2 seconds (2000 milliseconds).
To learn about “permute” usage and syntax, you may refer to the MathWorks documentation link below: -
I hope this helps!
0 Comments
See Also
Categories
Find more on EEG/MEG/ECoG in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!