Effacer les filtres
Effacer les filtres

How to get the column number that have ones in a row?

2 vues (au cours des 30 derniers jours)
fyza affandi
fyza affandi le 26 Nov 2018
t(:,:,1) =
1 10 19 28 37 46 55 64 73 82
2 11 20 29 38 47 56 65 74 83
3 12 21 30 39 48 57 66 75 84
4 13 22 31 40 49 58 67 76 85
5 14 23 32 41 50 59 68 77 86
6 15 24 33 42 51 60 69 78 87
7 16 25 34 43 1 61 70 79 88
8 17 26 35 44 53 1 1 80 89
9 18 27 36 45 54 63 72 1 1
How to get the number of column for row 8 (only with 1) ?
The result will be column 7 & 8

Réponse acceptée

madhan ravi
madhan ravi le 26 Nov 2018
same like your previous question use:
idx=find(t(8,:,1)==1)
ind2sub(size(t),idx)

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by