Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
retriveing some specific value from several matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi suppose I have some matrix of same size.I,I1,I2,I3. among them I as follows
I =
1 1 1 1 8 1 2
1 1 8 8 8 2 1
1 8 8 1 2 1 1
1 1 8 2 1 1 1
2 2 2 1 1 1 1
2 2 2 1 1 1 1
In I there are 3 distinct value 1,2 and 8.
I have declared a variable cell as follows:
InformationFromMatrix=cell(max(I(:))+1,1);
In each cell I need to store the following information:
There are seven 8.but seven of them are in boundary position with 1 and 2.
I need the following information in the 3rd cell:
8 1 1 5 1 4 column7 column8 column9
8 1 1 5 1 6 column7 column8 column9
8 1 3 2 2 2 column7 column8 column9
.....................................
8 2 3 3 4 4 column7 column8 column9
8 2 4 3 4 4 column7 column8 column9
.....................................
......................................
column1=8 ; 3rd distinct value
column2=1; one of 8's boundary value
column3= row index of the 8
column4= column index of the 8
column4= row index of the 1
column5= column index of the 1
column7 =absolute difference of I1 of position(1,5) and (1,4)
column8 =absolute difference of I2 of position(1,5) and (1,4)
column9 =absolute difference of I3 of position(1,5) and (1,4)
this so on will be for 1st and 2nd cell.
Is there any body to help me?
Thanks in advance.
댓글 수: 1
Oleg Komarov
2011년 5월 31일
What if an 8 (row 4, col 3) has two 2s and a 1 in the boundary (four connected compenents), which one to chose?
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!