[FieldTrip] error while using ft_freqanalysis

MOHAMED.ISSA at fci.bu.edu.eg MOHAMED.ISSA at fci.bu.edu.eg
Tue Jun 25 18:45:32 CEST 2024


i got this error
Index in position 2 is invalid. Array indices must be positive integers or logical values.
Error in ft_specest_hilbert (line 214)
spectrum(:,ifreqoi,:) = dum(:,timeboi+prepad);
Error in ft_freqanalysis (line 697)
[spectrum,foi,toi] = ft_specest_hilbert(dat, time, 'timeoi', cfg.toi, 'width', cfg.width, bpfiltoptions{:}, options{:}, 'feedback', fbopt, 'edgeartnan', cfg.edgeartnan);
while trying to process the folowing code
cfg = [];
cfg.method = 'hilbert';
cfg.output = 'fourier';
cfg.foi = 1:0.5:15;
cfg.channel = 'all';
cfg.bpfilttype = 'firws'; % Default filter type
cfg.bpfiltord = 4; % Filter order, can be adjusted as needed
cfg.pad = 'nextpow2'; % Padding option to improve FFT efficiency
cfg.toi = data_epoched.time{1};
% Perform frequency analysis with FieldTrip
freq = ft_freqanalysis(cfg, data_epoched);



  *   Operating System: [Windows 11
  *   MATLAB version R2023a
  *   FieldTrip version [e.g., 20240504


​​--
Accept all My Regards

​​Mohamed Issa
Postdoctoral Researcher at BCBL
www.bcbl.eu

-----------------------------------------------------------------------
We are working flexibly at BCBL. I am sending this message at a time that suits me. Please feel comfortable knowing that I do not expect you to read, respond to or action it outside of regular working hours.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240625/6be02523/attachment.htm>


More information about the fieldtrip mailing list