[Matlab] Allow nAtoms to take string inputs for species and elements
Resolves Issue 159.
This commit is contained in:
parent
3a308a041f
commit
16335a0932
1 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
function n = nAtoms(a,k,m)
|
function n = nAtoms(a,k,m)
|
||||||
% NATOMS - Number of atoms of element m in species k.
|
% NATOMS - Number of atoms of element m in species k.
|
||||||
if nargin == 3
|
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);
|
n = phase_get(a.tp_id,14,k,m);
|
||||||
else
|
else
|
||||||
error('usage: nAtoms(phase, k, m)')
|
error('usage: nAtoms(phase, k, m)')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue