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!