Effacer les filtres
Effacer les filtres

pick column and row of an entry

2 vues (au cours des 30 derniers jours)
Tomas
Tomas le 4 Mar 2013
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?

Réponse acceptée

Wayne King
Wayne King le 4 Mar 2013
Modifié(e) : Wayne King le 4 Mar 2013
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.

Plus de réponses (1)

Tomas
Tomas le 4 Mar 2013
Thank you for fast answer. Its wonderful.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by