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!