This repository has been archived by the owner on Aug 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indx_group_symbol.m
66 lines (62 loc) · 1.9 KB
/
indx_group_symbol.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function indx = indx_group_symbol( s,t )
%INDX_GROUP_SYMBOL Esta función retorna el índice para cada símbolo de
%grupo.
% INDX = INDX_GROUP_SYMBOL(S,T) retorna el índice asociado al símbolo del
% grupo S para el tipo T.
%
% T=0: Gravas
% T=1: Arena
if not(or(t==0, t==1))
error('Parameter t not valid, should be 0 or 1 for gravel and sand respectively.');
end
if not(ischar(s))
error('Group symbol must be an string.');
else
s = upper(s);
if t==0
if strcmp(s, 'GW')
indx = 0;
elseif strcmp(s, 'GP')
indx = 1;
elseif strcmp(s, 'GW-GM')
indx = 2;
elseif strcmp(s, 'GW-GC')
indx = 3;
elseif strcmp(s, 'GP-GM')
indx = 4;
elseif strcmp(s, 'GP-GC')
indx = 5;
elseif strcmp(s, 'GM')
indx = 6;
elseif strcmp(s, 'GC')
indx = 7;
elseif strcmp(s, 'GC-GM')
indx = 8;
else
error('Unrecognized gravel group symbol %s.', s);
end
elseif t==1
if strcmp(s, 'SW')
indx = 9;
elseif strcmp(s, 'SP')
indx = 10;
elseif strcmp(s, 'SW-SM')
indx = 11;
elseif strcmp(s, 'SW-SC')
indx = 12;
elseif strcmp(s, 'SP-SM')
indx = 13;
elseif strcmp(s, 'SP-SC')
indx = 14;
elseif strcmp(s, 'SM')
indx = 15;
elseif strcmp(s, 'SC')
indx = 16;
elseif strcmp(s, 'SC-SM')
indx = 17;
else
error('Unrecognized sand group symbol %s.', s);
end
end
end
end