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

조회 수: 1 (최근 30일)
fyza affandi
fyza affandi 2018년 11월 26일
답변: madhan ravi 2018년 11월 26일
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