adds new atom to an sw object ADDATOM(obj,'Option1', Value1, ...) Input: obj sw object Options: r Atomic positions, dimensions are [3 nAtom]. No default value! S Spin of the atoms, dimensions are [1 nAtom], for non-magnetic atoms set S to zero. Default spin is generated from the given label of the atom. For example if 'label' is 'MCr3+' or 'Cr3+' then the high spin of S=3/2 is automatically generated. The high spin values for every ion is stored in the last column of the ion.dat file. If the atom type is unknown S=0 is assumed. label Names of the atoms for plotting and form factor calculations (see ion.dat), it is a cell, optional. Example: {'atom1' 'atom2' 'atom3'} Default value is 'atomI', where I is the atom index. color Colors of the atoms for plotting, dimensions are [3 nAtom], where each column describes an RGB color. Each value is between 0 and 255, optional. Default value is [255;165;0] for each atom. Alternatively a name of the color can be given as a string, for example 'White', for multiple atoms package it into a cell. For the list of colors, see sw_colorname(). Output: The function creates extra elements in the 'unit_cell' field of the obj sw object. Example: crystal.ADDATOM('r',[0 1/2; 0 0; 0 0],'S',[1 0],'color',{'red' 'blue'}) Adds a magnetic atom (S=1) at position (0,0,0) and a non-magnetic one at (1/2 0 0) with red and blue color respectively. See also SW.GENLATTICE, SW.ADDMATRIX, SW_COLORNAME.