11.6: Exercise- The ALLEEG Variable and Redrawing the GUI
-
- Last updated
- Save as PDF
EEGLAB can have multiple datasets stored in memory simultaneously, which you can see in the Datasets menu. The current dataset is stored in the EEG variable. All of the datasets (including a copy of the current dataset) are stored in a variable named ALLEEG , which is just an array of EEG variables. When you go to the Datasets menu, you’re seeing a list of the datasets stored in ALLEEG . This is one reason why changing the name of EEG.setname didn’t cause a change in the Datasets menu. That is, we changed the name of this field in the EEG variable, but not in the ALLEEG variable that is used for the Datasets menu.
Let’s fix that by typing ALLEEG(1) = EEG; on the command line (including the semicolon so that it doesn’t print the new value in the Command Window). Now type ALLEEG(1).setname , and you’ll see that the first (and only) EEG structure in ALLEEG has the new name.
However, if you look in the Datasets menu, you still won’t see the new name for the dataset. This is because the Matlab GUI doesn’t “know” that the ALLEEG variable has changed. That is, the GUI only updates the names listed in the menu when it thinks that something has changed. You can tell Matlab to update the EEGLAB GUI by typing eeglab redraw on the command line. Try this, and then look at the Datasets menu. Now you should see the updated name. Note that there’s also an erplab redraw command for updating the ERPLAB and ERPsets menus.
Now let’s see what happens when we have two datasets loaded in EEGLAB. To make the second dataset, filter the dataset you already have loaded ( EEGLAB > ERPLAB > Filter and Frequency Tools > Filters for EEG data ) using a high-pass cutoff at 0.1 Hz, a low-pass cutoff at 30 Hz, and a roll-off of 12 dB/octave. Name the resulting dataset 01_N170_filt . You should now see two datasets in the Datasets menu.
If you look at the EEG tab in the Variables pane, you will see that EEG.setname is now 01_N170_filt . This is because the EEG variable always holds the currently active dataset (which is the filtered dataset you just created). If you look in the Variables pane, you’ll see that ALLEEG now has a size of 1 x 2 because we have two datasets loaded. If you type ALLEEG(1).setname , you’ll see the name of the first dataset. If you type ALLEEG(2).setname , you’ll see the name of the second dataset.
Leave these two datasets loaded for the next exercise.