I have a large table of triplets whose structure is:
list=Table[{a,b, RandomReal[]}, {a,1,100}, {b,1,100}]
I would like to search through the list by looking for the closest entry labeled by {a,b}
to a given input {x,y}
and return the associated third item in the triplet. To give an example, if I have
{x, y} = {10.2, 5.1}
I would like to return the triplet
{10, 5, c}
Where c
is the associated random real in the table.
I have tried using Nearest
, but the structure of the table does not seem compatible with search.