How to get the indices of specified name

1 visualización (últimos 30 días)
Kanakaiah Jakkula
Kanakaiah Jakkula el 15 de Abr. de 2017
Comentada: Kanakaiah Jakkula el 16 de Abr. de 2017
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

Respuesta aceptada

the cyclist
the cyclist el 15 de Abr. de 2017
C = {'Mek989.0';
'YTG873.0';
'RFD645.0';
'RFD645.0';
'WER134.0';
'WER134.0'};
output = find(not(ismember(C,'RFD645.0')));
  7 comentarios
the cyclist
the cyclist el 15 de Abr. de 2017
You mean you want to find the first element that does not match?
indx=find(not(strcmpi(C,'RFD645.0')),1,'first')
Kanakaiah Jakkula
Kanakaiah Jakkula el 16 de Abr. de 2017
Yes, It works, perfect. Thanks a lot.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by