I know this question has been asked a number of times, but a thorough search did not help me find an answer and as I am very new to matlab I need some help. I need to count the number of peaks in a large body of EEG data. The code below allows me to plot what the data looks like (for 1 piece of data). I need to count the really long narrow spikes. I know there are a bunch of peakfinder functions out there but I have no idea how to use them because they are all vector based and I don't know how to reference the vectors that are preprocessed in the script (fieldtrip). A simple threshold function wouldn't work because there is a lot of overall noise that is not related to what I want to count. This is what the data looks like: This is the script I have: % create the trial definition cfg=[]; cfg.filename = ['I:\EEG\',SubNum{subject},'\',FolderName, GroupName, SeqNum{subject}, '_', SubNum{subject}, '_Block', num2str(block), '.bdf']; cfg.dataset = cfg.filename; cfg.continuous = 'yes'; data_org = ft_preprocessing(cfg) channel = 164; plot(data_org.time{1}, data_org.trial{1}(channel, :)) xlabel('time (s)') ylabel('channel amplitude (uV)') legend(data_org.label(channel)) I don't know if it's asking too much, but I would really appreciate some guidance, I've been trying to use GUI's forever and it's no luck...but my coding skills are completely insufficient.
Prashant Kumar answered .
2025-11-20