How to get the indices of specified name
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I have below cell array
Mek989.0
YTG873.0
RFD645.0
RFD645.0
WER134.0
WER134.0
my specified name:RFD645.0, and I want to find the indices of rows which is not "RFD645.0" here in this case, row1,2,5,6. My desired output is:
1
2
5
6
댓글 수: 0
채택된 답변
the cyclist
2017년 4월 15일
C = {'Mek989.0';
'YTG873.0';
'RFD645.0';
'RFD645.0';
'WER134.0';
'WER134.0'};
output = find(not(ismember(C,'RFD645.0')));
댓글 수: 7
the cyclist
2017년 4월 15일
You mean you want to find the first element that does not match?
indx=find(not(strcmpi(C,'RFD645.0')),1,'first')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!