How to split a matrix based on array similarity

I have matrix A as follows:
A = [123 223 225 123
123 223 224 123
123 223 225 123
123 225 123 23
123 223 224 123
123 223 224 123
123 223 225 123
123 223 224 123
123 223 123 23
];
I want to find similar rows and have their row numbers in another set of matrices:
A1 = [1;2;3;4];
A2 = [5;6;7];
A3 = [8];
A4 = [9];
% numbers inside matrices A1 to A4 refers to row numbers in matrix A

Antworten (1)

michio
michio am 12 Dez. 2016

0 Stimmen

I am not sure how you define "similarity" but you can try out clustering functions available in Statistics and Machine Learning Toolbox to partition rows in A into k clusters.
clusterdata(A,'maxclust',4)
or
kmeans(A,4)

Kategorien

Gefragt:

am 11 Dez. 2016

Beantwortet:

am 12 Dez. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by