Ideal way for me to group a large data set by clusters?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 2 data sets both are 1x62. They could be combine or not as a 2x62.
x= 4 6 9 11 17 23 25 30 33 37 41 43 48 348 362 365 369 372 375 385 387 390 392 401 411 419 431 433 435 449 994 1009 1013 1017 1023 1027 1031 1033 1038 1043 1047 1049 1053 1059 1065 2363 2370 2372 2374 2378 2382 2393 2399 2401 2403 2409 2412 2424 2426 2430 2434 2444
and
y = 0.5841 0.5941 0.6007 0.6084 0.5776 0.5276 0.5108 0.4676 0.4531 0.4378 0.4411 0.4390 0.4349 0.4521 0.5807 0.6110 0.6278 0.6397 0.6414 0.7067 0.7113 0.7104 0.7133 0.7507 0.6859 0.6287 0.5617 0.5616 0.5543 0.4395 0.4660 0.5413 0.5610 0.5763 0.5638 0.5840 0.5919 0.5904 0.5768 0.5332 0.5215 0.5179 0.5067 0.4695 0.4497 0.4748 0.5047 0.5184 0.5179 0.5516 0.5764 0.6230 0.6556 0.6586 0.6606 0.6224 0.6022 0.5095 0.5001 0.4944 0.4914 0.4219
they do correspond to one another as x,y points on a graph. I would like to know how can I group the two by x components. ie the values of the 1xxx's and corresponding y components are 1 group. Then search and locate the maximum y value to output the corresponding x value. What this is suppose to do for me is to pick out peaks above y value of 0.4 (which I have already accomplished) and select the absolute largest amplitude value and give me it's x-position.
I have so far
%input cc is the result of Matlab's xcorr function: cc=max(xcorr(a,b(i:n),'coeff'))
[pks,locs] = findpeaks(cc,'MinPeakHeight',0.4); % 'MinPeakHeight' is from a toolbox
x = locs
y = pks
temp = abs(diff(x));
indx = find(temp>20); % my attempt to being able to identify a way to block these numbers
for w=1:indx % an attempt on trying to create separate groups
npks=y(w:indx)
nlocs=x(w:indx)
end
for ii =1:(length(indx)-1);
gloc(ii) = (x((indx(ii)+1):indx(ii+1)));
gpks(ii) = (y((indx(ii)+1):indx(ii+1)));
end
% I do not know the size of my "groups" before hand. I do not know the number groups that will be created from this. The absolute peaks per group are also not in the center. I hope I am being descriptive enough.
0 Kommentare
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!