possible to use logical indexing with an array argument ?

2 visualizaciones (últimos 30 días)
RuiQi
RuiQi el 17 de En. de 2017
Comentada: John Chilleri el 18 de En. de 2017
is there a way I can convert this code
for i=1:15653
label == i
end
to a vectorized one ?
i=1:15653;
label == i
  1 comentario
Stephen23
Stephen23 el 17 de En. de 2017
Editada: Stephen23 el 17 de En. de 2017
What is wrong with
i=1:15653;
label == i
?
What do you want to do with this?

Iniciar sesión para comentar.

Respuesta aceptada

John Chilleri
John Chilleri el 17 de En. de 2017
Editada: John Chilleri el 17 de En. de 2017
Hello,
WhateverYouWant = (label == 1:15653);
Note: assuming label is also a 15653 length vector OR a scalar.
Hope this helps!
  2 comentarios
RuiQi
RuiQi el 18 de En. de 2017
Sorry I was sure it didnt work when I typed
la
label == i
earlier on
John Chilleri
John Chilleri el 18 de En. de 2017
No worries! Glad I could help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Numeric Types 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