I have two arrays 1x4 'x' and 'y'. I want to find which combination of "pairs" elements between these two arrays will give the minimum difference (the elements of the array are the angles). I want to find WHICH elements must be paired to get this minimum. I do not care about the very minimum of the result. I tried using indexing but got nothing.
Example:
x=[x1 x2 x3 x4], y=[y1 y2 y3 y4].
x=[ 295 10 25 18 ], y=[ 200 290 245 326]
I get the minimum angle difference between x and y 'xyMin' from here:
Calculating the absolute differences between the two angles
xyMin= [ 95 80 140 52];
This is the minimum difference between angle elements from 2 arrays. However, I want to know which elements of the arrays were conjugated to give this minimum. So I need to get something like:
[Example]
xyArrayElementsThatGiveMinCombination: [x1-y3, x2-y4, x3-y1, x4-y2].
Edition:
, WHICH- "x" "y", . x [1 2 3 4] -y [1 2 3 4] . , , .
, , !
!