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

1 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by