How Can I group Matrix elelments

2 次查看(过去 30 天)
ben omar
ben omar 2017-7-23
编辑: Stephen23 2017-7-24
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

回答(1 个)

John BG
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

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by