nearest_spin.m

From Spinach Documentation Wiki
Revision as of 15:03, 5 April 2026 by Kuprov (talk | contribs) (Sync syntax/arguments/outputs with current Spinach source)
Jump to: navigation, search


Returns the index of the nearest spin to the one specified. Only spins for which Cartesian coordinates are available are considered.

Syntax

[k,d]=nearest_spin(spin_system,n)

Arguments

n - index of the spin in question

Outputs

k - index of the nearest spin

   d   - distance to the nearest spin, Angstrom
ilya.kuprov@weizmann.ac.il

See also

Spin system specification

Spin system editing


Version 2.8, authors: Ilya Kuprov