Qurak

Nearest

Verfügbar

Find the nearest elements in a list to a given value.

Nearest[{elem1, elem2, …}, x]
Nearest[{elem1 -> v1, elem2 -> v2, …}, x]
Nearest[{elem1, elem2, …} -> {v1, v2, …}, x]
Nearest[{elem1, elem2, …} -> prop, x]
Nearest[data, {x1, x2, …}]
Nearest[data, x, n]
Nearest[data, x, {n, r}]
Nearest[data]
Nearest[{1, 5, 10, 12}, 11] → {10, 12}Nearest[{1, 2, 3, 10}, 4, 2] → {3, 2}Nearest[{"cat", "car", "dog"}, "cot"] → {cat}Nearest[{}, 1] → Nearest::near1: {} is neither a list of real points nor a valid list of rules. Nearest[{}, 1]Nearest[5, 1] → Nearest::near1: 5 is neither a list of real points nor a valid list of rules. Nearest[5, 1]Nearest[{{0, 0}, {3, 4}}, {0, 1}, DistanceFunction -> ManhattanDistance] → {{0, 0}}Nearest[{1, 2, 3, 10}, 4, DistanceFunction -> (-Abs[#1 - #2] &)] → {10}Nearest[{1, 2, 3, 10}, 4, 2, DistanceFunction -> (Abs[#1 - #2] &)] → {3, 2}Nearest[{1, 2, 3, 10}, 4, Method -> Automatic] → {3}

Verwendet in

Themen

Verwandt

Alle 6300 Funktionen · Dies aus einem MCP-Client verwenden