[which] = mne_find_channel(info,name) Find a channel by name employing the info structure output by mne_raw2mat or mne_epochs2mat epoch - The data structure containing the channel information name - name of the channel to look for Returns index of the channel in the data If the channel is not found, returns -1
0001 function [which] = mne_find_channel(info,name) 0002 % 0003 % [which] = mne_find_channel(info,name) 0004 % 0005 % Find a channel by name employing the info structure 0006 % output by mne_raw2mat or mne_epochs2mat 0007 % 0008 % epoch - The data structure containing the channel information 0009 % name - name of the channel to look for 0010 % 0011 % Returns index of the channel in the data 0012 % If the channel is not found, returns -1 0013 % 0014 0015 % 0016 % 0017 % Author : Matti Hamalainen, MGH Martinos Center 0018 % License : BSD 3-clause 0019 % 0020 % 0021 % $Id: mne_find_channel.m 8776 2013-11-14 09:04:48Z roboos $ 0022 % 0023 % Revision 1.4 2006/04/23 15:29:40 msh 0024 % Added MGH to the copyright 0025 % 0026 % Revision 1.3 2006/04/14 15:49:49 msh 0027 % Improved the channel selection code and added ch_names to measurement info. 0028 % 0029 % Revision 1.2 2006/04/10 23:26:54 msh 0030 % Added fiff reading routines 0031 % 0032 % Revision 1.1 2006/02/20 15:45:05 msh 0033 % Added mne_find_channel.m and mne_read_epoch.m 0034 % 0035 % 0036 me='MNE:mne_find_channel'; 0037 if(nargin ~= 2) 0038 error(me,'Usage : [which] = mne_find_channel(info,which)'); 0039 end 0040 0041 which = strmatch(name,info.ch_names,'exact'); 0042 0043 return;