[Matlab] Allow nAtoms to take string inputs for species and elements

Resolves Issue 159.
This commit is contained in:
Bryan W. Weber 2014-01-06 18:46:30 +00:00
parent 3a308a041f
commit 16335a0932

View file

@ -1,6 +1,12 @@
function n = nAtoms(a,k,m)
% NATOMS - Number of atoms of element m in species k.
if nargin == 3
if ischar(m)
m = elementIndex(a,m);
end
if ischar(k)
k = speciesIndex(a,k);
end
n = phase_get(a.tp_id,14,k,m);
else
error('usage: nAtoms(phase, k, m)')