How to compare data from two different data systems y1,x1 and y2,x2?
1 次查看(过去 30 天)
显示 更早的评论
Hello dear community,
I want to compare data from two different data systems y1,x1 and y2,x2.
First you see a plot:
The Values are (for example)
Red plot is a "Motor 1" Line and have y1,x1 values: (41,0.1),(40,0.2),(40,0.3),(41,0.4),(39,0.5),....,(42,n).
The cyan line/points are "Trajectory" Line and have y2,x2 values: (43,0.29),(40,0.38),(41,0,49),(40,0.78),....,(41,n).
I want to compare this values (with true positive/false negative methods) and have to find out, how far away is a y2 value from y1 value. The problem is, there are different x points, so how it is possible to analyze both data arrays?
Thank you very much in advice!
Sincerely yours, Nik
0 个评论
回答(1 个)
Walter Roberson
2020-5-23
You can use pdist2() to find the distance from each x1/y1 point to each x2/y2 point, and then use min() . Or you can use knnsearch to find the 1 point in x2/y2 that is closest toeach x1/y1 point.
But... then what?
Sometimes what people do in these kinds of situations is to interp1(x2, y2, x1) to find the value in x2/y2 that would be "predicted" for x1, and from there you can compare to the actual y1 value to make some kind of determination.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!