I am trying to do beamforming on some MEG data. However, some of the sensors railed during the recordings, so I want to remove them from the analysis. I declare the channels I want to use during import with ft_preprocessing by saying:<br>

cfg.channel                 = {'MEG','-TRIGGER','-RESPONSE',...<br>    '-UACurrent','-MxA','-MyA','-MzA','-GxxA','-GyxA','-GyyA',...<br>    '-GzyA','-GzxA','-MxaA','-MyaA','-MzaA','-E1','-E2','-E3','-E4',...<br>

    '-A40','-A57','-A76','-A77','-A79','-A81','-A88','-A89','-A96',...<br>    '-A100','-A102','-A103','-A108','-A112','-A113','-A114','-A116',...<br>

    '-A120','-A121','-A123','-A124','-A125','-A126','-A127','-A128',...<br>    '-A129','-A130','-A131','-A124','-A139','-A140','-A141','-A142',...<br>

    '-A144','-A145','-A146','-A147','-A148'}; <br><br>Then I use ft_freqanalysis to calculate the cross spectral density and ft_prepare_leadfield to create the brain grid. When I try to run ft_sourceanalysis, I get this error:<br>

creating dipole grid based on user specified dipole positions<br>13718 dipoles inside, 144943 dipoles outside brain<br>???  In an assignment  A(I) = B, a matrix A cannot be resized.<br><br>Error in ==> prepare_freq_matrices at 115<br>

    Cf(find(crsspctrmindx)) = freq.crsspctrm(crsspctrmindx(find(crsspctrmindx)), fbin);<br><br>Error in ==> ft_sourceanalysis at 461<br>    [Cf, Cr, Pr, Ntrials, cfg] = prepare_freq_matrices(cfg, data);<br><br><br>I think it is because I have removed channels. When I try to run ft_freqanalysis while specifying the channels in cfg.channel, i get this error:<br>

the input is raw data with 111 channels and 60 trials<br>??? Error using ==> ft_freqanalysis at 352<br><b>channels in cfg.channelcmb not present in cfg.channel</b><br><b><br></b>I think I need to explicitly define cfg.channelcmb, but I don't know how to do this if I have removed channels.<br>

<br>-Allison<br>