I need to build an arrangement from the elements of two other arrangements. With the following code an array is generated but only with the last two values of X and Y.
X = [0 7.313 14.632 18.238 18.308 18.383 18.394 18.395 18.395 18.395 18.395]
Y = [10.882 18.276 21.939 22.018 22.093 22.105 22.106 22.106 22.106 22.106 22.106]
Z = zeros(22,1) ;
for i = 1:2:22
for j = 2:2:22
for m = 1:11
for n = 1:11
Z(i,:) = X(:,m) ;
Z(j,:) = Y(:,n) ;
end
end
end
end
output: Z = 18.395
22.106
18.395
22.106
18.395
22.106
...
But I need to get the Z array as follows:
expected output: Z = X(1)
Y(1)
X(2)
Y(2)
X(3)
Y(3)
...
with the values: Z = 0
10.882
7.313
18.276
14.632
21.939
...
Thanks.