index channel location error
显示 更早的评论
chan1idx = find(strcmpi(channel1,{EEG.chanlocs.labels}));
chan2idx = find(strcmpi(channel2,{EEG.chanlocs.labels}));
Dear all, I am trying to direct the index of channel 1 to the corresponding value in my EEG.chanlocs file.
But I keep on getting this error:
Intermediate dot '.' indexing produced a comma-separated list with 20 values, but
it must produce a single value to perform subsequent indexing operations.
What should I change?
Thanks!!
6 个评论
Walter Roberson
2021-7-2
Your EEG is a non-scalar struct. You can only index one level into it.
It is not clear that EEG(K).chanlocs is a scalar struct itself, or that EEG(K).chanlocs(1).labels is scalar, and those things will matter for producing useful code.
Carmen Sergiou
2021-7-2
Walter Roberson
2021-7-2
Your EEG is nonscalar struct. Each entry of it contains the nonscalar struct chanlocs. Each chanlocs contains labels which is a character vector.
When you do the find() are you asking to identify the EEG index for which some chanlocs.labels matches? Or are you asking to identify the chanlocs index that matches for some EEG? If you are trying to identify the J, K pair for which EEG(J).chanlocs(K).labels matches then you cannot do that with a single find()
Carmen Sergiou
2021-7-2
Walter Roberson
2021-7-2
Are the labels the same for all EEG entries?
Carmen Sergiou
2021-7-5
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!