How to align multiple datasets but data are not totally identical
조회 수: 17 (최근 30일)
이전 댓글 표시
Hi, I'm new to Matlab and I have some questions regarding data alignment. I've seen similar questions already, like this one:
https://es.mathworks.com/matlabcentral/answers/429858-how-to-align-multiple-datasets
So in my case I also want to align two datasets but values are not totally similar, so I would like to know if there is a script that allows me to align datasets but adding some relative deviation. For example, I want to align values of 13.0 with values ranging from 12.5 to 13.5 (13.0+-0.5). Is this possible?
Thank you very much in advance
댓글 수: 2
Image Analyst
2022년 5월 16일
What form are your data in? Like a set of (x,y,z) point coordinates? Did you try a web search for "point set matching"
답변 (1개)
Abhijit Bhattacharjee
2022년 5월 19일
Without seeing a bit more detailed of an example, it's not easy to recommend the best path forward. But you could consider creating a copy of your data with rounded or binned values that you use for alignment, and then use the aligned indices to recover the original data of the alignment.
Here's a quick example:
% create example arrays to be aligned
idx1 = [1 2 3.05 3.95 5]';
idx2 = [2 3.01 4.03]';
A = array2table([idx1, randn(size(idx1))])
B = array2table([idx2, randn(size(idx2))])
% round the arrays
idx1_rounded = round(idx1);
idx2_rounded = round(idx2);
A_rounded = A;
A_rounded.Var1 = idx1_rounded
B_rounded = B;
B_rounded.Var1 = idx2_rounded
% align the arrays
result = outerjoin(A_rounded, B_rounded, 'Keys', [1,1])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!