-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateLPPrototypeDescriptor.m
More file actions
35 lines (33 loc) · 1.03 KB
/
createLPPrototypeDescriptor.m
File metadata and controls
35 lines (33 loc) · 1.03 KB
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
function [descriptor] = createLPPrototypeDescriptor(gs, ramaSerieParalelo)
N = length(gs);
descriptor = cell(3, N);
%Fila 1: tipo de elemento (L o C)
%Fila 2: valor de ese elemento
%Fila 3: si está en rama serie o rama paralelo
if(ramaSerieParalelo == 2)
for x=1:N
if(mod(x,2) == 1)
descriptor{1, x} = 'C';
descriptor{2, x} = gs(x);
descriptor{3, x} = 'P';
else
descriptor{1, x} = 'L';
descriptor{2, x} = gs(x);
descriptor{3, x} = 'S';
end
end
end
if(ramaSerieParalelo == 1)
for x=1:N
if(mod(x,2) == 1)
descriptor{1, x} = 'L';
descriptor{2, x} = gs(x);
descriptor{3, x} = 'S';
else
descriptor{1, x} = 'C';
descriptor{2, x} = gs(x);
descriptor{3, x} = 'P';
end
end
end
end