Hello, I have a vector with data and, when I plot them, they divide into four patterns, as you can see in the figure (the 2 of them in the middle are very close). I also know from the theory that I should have 4 of these curves. Because of numerical errors, I cannot analytically identify these groups. Therefore, I tried kmeans, and I used the following code
R = real(vector(1:2:end));
I = imag(vector(1:2:end));
X = [R I];
[idx,~] = kmeans(X,4,'replicates',5);
legend('Cluster 1','Cluster 2','Cluster 3','Cluster 4')
However, how you can see in the figure, the clustering is horizontal, whereas it should be vertical.
I tried to tune the kmeans function with no success. I think the problem could be the different scale for the x and y data. I tried to multiply the x data for 1e2, but nothing changed. Does anyone have any idea how can I correctly cluster these data? I also attach the vector of data I am using. The values are complex conjugate, and in the plot, I am plotting only the values for the negative imaginary part.