data = sw_atomdata(atomsymb)

data = sw_atomdata(atomsymb,datatype)


data = sw_atomdata(atomsymb) returns information on chemical elements (RGB color code, mass, long name) in a struct. The element is identified by its short name, such as ‘O’ for oxygen. If the given atom name does not exists, the function returns the data for 'Unobtanium'. The database is stored in the atom.dat file.

data = sw_atomdata(atomsymb,datatype) returns only the requested type of data.


The radius of the hydrogen atom:

r_H = sw_atomdata('H','radius')


r_H =

Input Arguments

String of the name of the atom, for example ‘He’ or the atomic number Z. If the string contains whitespace character, the second word will be used to identify the atom.
Type of information requested, following strings are accepted:
  • 'name' Atomic symbol.
  • 'radius' Atomic radius.
  • 'color' Color of the atom from the CPK color scheme.
  • 'mass' Average mass of the element.
  • 'longname' Name of the element.
  • 'Z' Atomic index.
  • 'all' All atomic data returned in a struct.

See Also

sw_mff | sw_cff