How to align multiple datasets but data are not totally identical
18 ビュー (過去 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!