How do I import .mat files into MNE?

I’ve been trying to import mat data into mne.

I’ve attempted to look at the tutorials on MNE - LINK and multiple other youtube videos as well…

But nothing seems work. Perhaps it’s a problem with my dataset…

I’m linking the github repo for it below, you can check out the jupyter notebook on it for my pipeline.

Basically when I try to plot my data using raw.plot(), nothing plots. I changed the duration within the function so that isn’t a problem there.

Hi @vxnuaj - welcome to the forum!

Just to clarify/confirm… Your issue is that when you call raw.plot, there isn’t any figure shown?

Can you try running mne.viz.set_browser_backen("matplotlib") in the cell above raw.plot, and then try running raw.plot again?

Yeah, thanks for the help. One of the things I was trying to figure out was how to make a plot appear inline on jupyter notebooks. This solved it.

But the issue I was mentioning related to the actual data being plotted on a graph.

It appears as if my dataset isn’t able to plotted onto it – for context, I’m using a .mat file.

I’m attaching an image to show what it looks like. Shouldn’t there be data printed onto the plot? it just shows as a blank black canvas.

I updated my github a little btw; made slight adjustments. still nothing

nvm fixed it. used scalings = “auto” on the raw.plot

1 Like

Awesome. Since your EEG data are coming from MATLAB the data units are likely microvolts. MNE expects the data to be in Volts. Doing:

raw.apply_function(lambda x: x*1e-6, channel_wise=False)

will convert the units to volts, afterwhich you probably don’t need to use "auto" during plotting.

1 Like

ok, cool! this def helps a lot, I was pretty confused why my data looked so strange… thanks!