-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_user.m
63 lines (56 loc) · 1.88 KB
/
do_user.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
function s_user = do_user( type, instants, zz, xx, yy)
%function s_user = do_user( type, instants, zz, xx, yy)
%
%Constructs the user structure for map, xz, yz or xyz.
ninstants = length(instants);
switch type
case 'map'
nlayers = length(zz);
for n = 1 : ninstants
for k = 1 : nlayers
s_user(n,k) = struct(...
'instant', instants(n), ...
'layer', zz(k), ...
'xrange', xx, ...
'yrange', yy, ...
'type', type ...
);
end
end
case 'xz'
jsections = length(yy);
for n = 1 : ninstants
for j = 1 : jsections
s_user(n,j) = struct(...
'instant', instants(n), ...
'zrange', zz, ...
'xrange', xx, ...
'ysection', yy(j), ...
'type', type);
end
end
case 'yz'
isections = length(xx);
for n = 1 : ninstants
for i = 1 : isections
s_user(n,i) = struct(...
'instant', instants(n), ...
'zrange', zz, ...
'xsection', xx(i), ...
'yrange', yy, ...
'type', type);
end
end
case 'xyz'
for n = 1 : ninstants
s_user(n) = struct(...
'instant', instants(n), ...
'zrange', zz, ...
'xrange', xx, ...
'yrange', yy, ...
'type', type);
end
otherwise
disp('Error in type!');
return
end