How Can I group Matrix elelments
조회 수: 14 (최근 30일)
이전 댓글 표시
I have 10 by 10 matrix, were rows and columns represent machine numbers So A(i,j) represent some coherency index betwing machine i and j
A = [ 0 0.0059 0.0092 0.0102 0.0103 0.0110 0.0114 0.0112 0.0110 0.0110
0.0059 0 0.0034 0.0045 0.0049 0.0056 0.0061 0.0059 0.0059 0.0058
0.0092 0.0034 0 0.0016 0.0025 0.0032 0.0036 0.0035 0.0037 0.0037
0.0102 0.0045 0.0016 0 0.0011 0.0017 0.0021 0.0020 0.0023 0.0022
0.0103 0.0049 0.0025 0.0011 0 0.0008 0.0013 0.0011 0.0013 0.0012
0.0110 0.0056 0.0032 0.0017 0.0008 0 0.0005 0.0004 0.0007 0.0007
0.0114 0.0061 0.0036 0.0021 0.0013 0.0005 0 0.0003 0.0007 0.0007
0.0112 0.0059 0.0035 0.0020 0.0011 0.0004 0.0003 0 0.0004 0.0004
0.0110 0.0059 0.0037 0.0023 0.0013 0.0007 0.0007 0.0004 0 0.0001
0.0110 0.0058 0.0037 0.0022 0.0012 0.0007 0.0007 0.0004 0.0001 0];
I want class the machines into groups condition if A(i,j) < let say 0.01 the two machines can be grouped
How can I do that ,
Than you
댓글 수: 0
답변 (1개)
John BG
2017년 7월 23일
편집: John BG
2017년 7월 23일
you can split A into low and high values, with the given threshold of 0.01
Alow=A(A<.01)
Ahigh=A(A>=.01)
with
[rowAlow,colAlow,v]=find(A(A<.01));
in colAlow you get the positions of the A elements smaller than threshold.
Same for positions of larger elements.
[rowAhigh,colAhigh,v]=find(A(A>=.01));
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!