I’m trying to extract features from some EEG signals. One of the trails in my for loop creates inf value and emd doesn’t accept it so it causes an error! Would you please tell me how I can fix it?! Thanks a lot in advance.

s = 1;
for i = LabelLeft
   SignalL = SignalMean(H.TRIG(i)+fs:H.TRIG(i)+(3*fs)-1,1);
   SignalLeft{s,:} = emd(SignalL,'MAXMODES',4);
   s = s+1;

   clear SignalL

1 Answers

User1551892 On

You can inf from array using method shown below:

k = [inf 1 2]
k =

   Inf     1     2
k = k(~(isinf(k)))
k =

     1     2