Indexing of an array

1 visualización (últimos 30 días)
galben
galben el 20 de Oct. de 2022
Comentada: galben el 22 de Oct. de 2022
I have a result array of 50 x 50 and i would like to extract all information for when a certain column equal a certain result.
  1 comentario
David Hill
David Hill el 20 de Oct. de 2022
Hard to understand what you are asking. A simple example would be beneficial.

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 20 de Oct. de 2022
Editada: Matt J el 20 de Oct. de 2022
Simplified example:
array=randi(10,5)
array = 5×5
10 10 7 2 4 4 7 10 7 10 1 8 4 2 7 3 7 10 5 5 9 7 10 10 2
test=array(:,5)>4;
subset=array(test,:) %rows where 5th column is greater than 4
subset = 3×5
4 7 10 7 10 1 8 4 2 7 3 7 10 5 5
  1 comentario
galben
galben el 22 de Oct. de 2022
thanks this worked well

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by