pick column and row of an entry

Hi, i would like to know is there any function which allow me to pick matrix entries greater than 10 and print those entries rows and columns in cells or in 2 separate matrices?

 Respuesta aceptada

Wayne King
Wayne King el 4 de Mzo. de 2013
Editada: Wayne King el 4 de Mzo. de 2013

0 votos

X = randi(20,10);
[I,J] = ind2sub(size(X),find(X>10));
The I vector has the row indices, the J vector has the column indices. You can certainly store those indices however you like.

Más respuestas (1)

Tomas
Tomas el 4 de Mzo. de 2013

0 votos

Thank you for fast answer. Its wonderful.

Categorías

Más información sobre Dynamic System Models en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Mzo. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by