-
Notifications
You must be signed in to change notification settings - Fork 5
/
HGSelements.m
40 lines (37 loc) · 1.05 KB
/
HGSelements.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
function [eln,elq] = HGSelements(name)
%**************************************************************************
%
% HGSelements(name)
%
%**************************************************************************
%
% HGSelements returns the elements present in the species name and their
% number
%
%**************************************************************************
% Inputs:
%--------------------------------------------------------------------------
% name --> Name or code of the species
%
% Outputs:
% eln --> List with the name of the elements present in the species
% elq --> Vector with their quantities
%--------------------------------------------------------------------------
% Examples:
% [a,b]=HGSelements('H2O');
% [a,b]=HGSelements(2247);
%**************************************************************************
% *HGS 2.1
% *By Caleb Fuster, Manel Soria and Arnau Miró
% *ESEIAAT UPC
if isnumeric(name)
id=name;
else
id=HGSid(name);
end
global HGSdata;HGSload;
eln=HGSdata.ena(id);
eln=eln{1};
elq=HGSdata.nat(id);
elq=elq{1};
end