-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_arr.m
30 lines (26 loc) · 821 Bytes
/
test_arr.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
Y = rand(6, 25);
u = 7;
[x dd] = size(Y);
Y1 = zeros(x, dd+u);
cnt =1;
z_cnt = 1;
an_cnt = 0;
for i = 1:dd+u
if(z_cnt <= dd-u/2)
Y1(:,i) = Y(:,z_cnt);
if(cnt <= u)
if(mod(cnt, 2) == 0)
Y1(:,i) = Y(:,z_cnt);
z_cnt = z_cnt +1;
cnt = cnt+1;
else
Y1(:,dd+u-(i-1)) = Y(:,dd-an_cnt);
Y1(:,dd+u-i) = Y(:,dd-an_cnt);
an_cnt = an_cnt+1;
cnt = cnt+1;
end;
else
z_cnt = z_cnt +1;
end;
end;
end;