Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Nearest neighbors within radius

`nodeIDs = nearest(G,s,d)`

`nodeIDs = nearest(G,s,d,Name,Value)`

```
[nodeIDs,dist]
= nearest(___)
```

uses additional options specified by one or more name-value pair arguments. For
example, if `nodeIDs`

= nearest(`G`

,`s`

,`d`

,`Name,Value`

)`G`

is a weighted graph, then
`nearest(G,s,d,'Method','unweighted')`

ignores the edge weights
in graph `G`

and instead treats all edge weights as
`1`

.

`distances`

| `neighbors`

| `predecessors`

| `shortestpath`

| `shortestpathtree`

| `successors`