How do I add channels to exclude while keeping the channels already excluded?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alexandra Rowan O'Donnell
el 4 de Dic. de 2018
Comentada: Star Strider
el 4 de Dic. de 2018
Hi all, I'm having trouble with this piece of code. I'm trying to exclude a whole bunch of channels from a data set, but whenever I try and exclude extras, it ends up undoing the exclusionary criteria. Here's the code:
%% Channel Exclusion
figure;bar(ChanImpedances)
thres = 4*1e6; % set the threshold for the bad channel
hold on,plot(ones(1,length(ChanImpedances))*thres,'r--','LineWidth',2)
bad_channel = [];
bad_channel_o = [];
bad_channel_o = find(ChanImpedances > thres)
bad_channel = find(ChanImpedances > thres)
bad_channel_o = [bad_channel_o;32;128];
bad_channel = [bad_channel;32;128];
So it's already excluding a bunch of channels based upon impedance, but I also want to exclude others based upon visual criteria. Whenever I add:
bad_channel = [46];
It undoes the bad channel selection it just ran. How do I tell it to also exclude channel 46 along with the ones it's already excluded for impedance?
Thank you!
0 comentarios
Respuesta aceptada
Star Strider
el 4 de Dic. de 2018
If you want to add 46 to the bad channels, probably the easiest way is to ‘grow’ the vector:
bad_channel = [bad_channel; 46];
(This is not great programming practice. In some instances, it works best.)
2 comentarios
Star Strider
el 4 de Dic. de 2018
As always, my pleasure!
If the order is important, efficiency is secondary, and you want them sorted ascending (lowest first), you can add them whenever you want, then use:
bad_channel = sort(bad_channel);
Más respuestas (0)
Ver también
Categorías
Más información sobre RF Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!