-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathspektrElement2Z.m
47 lines (44 loc) · 1.57 KB
/
spektrElement2Z.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function Z = spektrElement2Z(element)
%%**************************************************************************
%% System name: SPEKTR
%% Module name: spektrElement2Z.m
%% Version number: 1
%% Revision number: 00
%% Revision date: 15-Mar-2004
%%
%% 2016 (C) Copyright by Jeffrey H. Siewerdsen.
%% I-STAR Lab
%% Johns Hopkins University
%%
%% Usage: e = spektrElement2Z(element)
%%
%% Inputs:
%% element - Abbreviation for the element of interest (string)
%%
%% Outputs:
%% Z - Atomic Number of an element of interest
%%
%% Description:
%% Returns the atomic number of an element given
%% the abbreviated form of the element. Abbreviations are case
%% sensitive. If the element abbreviation is not found Z=0 is
%% returned.
%%
%% Notes:
%%
%%*************************************************************************
%% References:
%%
%%*************************************************************************
%% Revision History
%% 0.000 2003 05 01 AW Initial code
%% 1.000 2004 03 15 DJM Initial released version
%%*************************************************************************
%%
% Filename for matlab file containing periodic table of element
% abbreviations
Filename_PeriodicTable='spektrPeriodicTable.m';
% Extract the periodic_table.m file which contains the atomic number and
% abbreviations for all the elements
data = textread(Filename_PeriodicTable,'%s\r'); %abbrev. of the elements & atomic #'s are stored here
Z = strmatch(element,data,'exact');