multiple grouping octave and layers
显示 更早的评论
Hey all, i want to ask how to grouping this data by octave (first column) and layer (second column), is there some way to do this? i thought it must be used groupcounts, i was tried, but still got an error. After grouping i must be sorted by the number. so i could know which minor of that group then proceed it first using kmeans(12) by at least 2 value every group. But if there is group that have less than 2, we skipped it.
1 1 159 92
1 1 111 43
1 1 111 64
1 1 119 56
1 1 131 113
1 2 192 121
1 2 192 104
1 2 203 63
2 2 147 84
2 2 150 73
2 2 166 31
2 2 167 70
2 2 171 70
2 2 181 32
2 2 183 80
2 2 185 85
3 1 200 18
3 1 134 63
3 2 110 31
groups would look like follows:
octave 3 and layer 2 = 1
octave 3 and layer 1 = 2
octave 1 and layer 2 = 3
octave 1 and layer 1 = 5
octave 2 and layer 2 = 8
result of kmeans must 12 point (i dont know how), so after using kmean at least like this below (number of group must be distributed)
octave 3 and layer 2 = 1
octave 3 and layer 1 = 2
octave 1 and layer 2 = 3
octave 1 and layer 1 = 3
octave 2 and layer 2 = 3
3 个评论
Elder Winter
2019-4-19
编辑:Elder Winter
2019-4-19
Image Analyst
2019-4-19
I didn't see where i was initialized. Anyway, we recommend against using i as an index or loop iterator/counter since it can also be used as the imaginary variable when using complex numbers. I have no idea what i and j even are so you should probably use a more descriptive variable name. Same comment for X, idx, and C -- use more descriptive names. It looks like C will get overwritten on each iteration and it doesn't look like you even do anything with it.
Elder Winter
2019-4-19
编辑:Elder Winter
2019-4-20
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Octave 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!