forked from I-STAR/SPEKTR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spektrZ2Element.m
52 lines (47 loc) · 1.57 KB
/
spektrZ2Element.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
48
49
50
51
52
function element = spektrZ2Element(Z)
%%**************************************************************************
%% System name: SPEKTR
%% Module name: spektrElement2Z.m
%% Version number: 1
%% Revision number: 00
%% Revision date: 15-Mar-2004
%%
%% 2004 (C) Copyright by Jeffrey H. Siewerdsen.
%% I-STAR Lab
%% Johns Hopkins University
%%
%% Usage: element = spektrZ2Element(Z)
%%
%% Inputs:
%% Z - Atomic Number of an element of interest
%%
%% Outputs:
%% element - Abbreviation for the element of interest (string)
%%
%% Description:
%% The function of this method is to return the atomic number of an element given
%% the abbreviated form of the element.
%%
%% 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';
% z = atomic number
% Access periodic table spreadsheet from " periodic_table.m "
data = textread(Filename_PeriodicTable,'%s\r'); %abbrev. of the elements & atomic #'s are stored here
% Extract element abbreviation, given atomic number(z)
if Z>=1 & Z<=length(data)
element = data(Z,1);
else
element = '';
end