WLJS LogoWLJS Notebook

NearestFunction

NearestFunction[data] represents a function whose values give the elements closest to an element that is supplied.

Examples

Create a nearest function and query it:

nf = Nearest[{1, 2, 5, 8, 10}]
nf[6]
(* {5} *)

Please visit the official Wolfram Language Reference for more details.

On this page