Answer:
A is the input array
B = [] ; %B is initially an empty array
for i = 1:length(A)/2 Â %iterates over A until the midpoint of A
  B(i) = A(i) + A(end + 1 - i);  %This adds the numbers from the first half and %second half of A, and stores in B
end
disp(B)