Hi all
I have 2 cell arrays.
one of them is my EEG bad channels and another is all EEG channels.
I want to find row numbers of the bad channels in my all EEG channels. For example, I have c4 in my bad channels and c4 in all channels file is 35.
and Fp2 is 3 in all channels. I want to do it by code. I've tried with:
idx = find(ismember(A,B))
but it works just when I put B in '' for instance:
idx = find(ismember(all_channels,'C4')) %ismember is case sensitive
I've attached my .mat files.
would you please help me.
Hamed

 채택된 답변

KL
KL 2017년 9월 25일
편집: KL 2017년 9월 25일

0 개 추천

ind = cellfun(@find,cellfun(@(c) strcmp(all_channels,c),bad_channels,'uni',0))

댓글 수: 3

hamed
hamed 2017년 9월 25일
Thanks a lot, KL.
The code is fine but it finds all channels with same words.
for example, for C4 it finds 25 and 35.
35 is C4 and 25 is FC4. in both we have C4 and code can't recognize.
The result should be just 35
Thanks
KL
KL 2017년 9월 25일
See my edited answer. This should do what you want.
hamed
hamed 2017년 9월 25일
yes, it works perfectly
Thanks a lot for your help

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

태그

질문:

2017년 9월 25일

댓글:

2017년 9월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by