importEEG = 'aEEG_patient1_EDFplus.edf'; needed = 'EEG'; cfg = []; cfg.dataset = importEEG; cfg.continuous = 'yes'; % Since some of the datasets are huge (>2 Gb), it becomes necessary to % split the datasets and only read the desired channels. % hdr = ft_read_header(importEEG); data = edf2fieldtrip('aEEG_patient1_EDFplus.edf'); %From edf to fieldtrip all_data = ft_channelselection({'all'},data.label); %Selecting all the channels in fieldtrip if needed == 'EEG' EEG_chan = ft_channelselection({'EEG*'},data.label); %Selecting EEG channels in fieldtrip cfg.channel = EEG_chan; data = ft_selectdata(cfg, data); %Selecting dataset EEG else if needed == 'other' other_chan = ft_channelselection({'all' '-EEG*'},data.label); %Selecting al the channels minus the EEG channels in fieldtrip cfg.channel = other_chan; data = ft_selectdata(cfg, data); %Selecting dataset of non EEG end end %importEEG = data; %hdr = ft_read_header(importEEG); ? not working