-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathvar_nodes.m
58 lines (49 loc) · 969 Bytes
/
var_nodes.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
function [var]=var_nodes(first,last,number)
var=[];
if number==6
tp(1)=first;
tp(2)=first+1;
for k=first+2:last/2-1
tp(3) =k;
for q=k+1:last/2
tp(4)=q;
for tt=q+1:last-1
tp(5)=tt; tp(6)=last;
var=[var;tp];
end
end
end
end
if number==5
tp(1)=first;
tp(2)=first+1;
for k=first+2:last/2
tp(3) =k;
for q=k+1:last-1
tp(4)=q;tp(5)=last;
var=[var;tp];
end
end
end
%%%%%%%%%%%%%%%%%%%%
if number==4
tp(1)=first;
for k=first+1:last-2
tp(2) =k;
for q=k+1:last-1
tp(3)=q;tp(4)=last;
var=[var;tp];
end
end
end
if number==3
tp(1) =first;
for q=first+1:last-1
tp(2)=q; tp(3)=last;
var=[var;tp];
end
end
if number==2
tp(1) =first;tp(2)=last;
var=[var;tp];
end