x = [3 6 9];
sum = 0;
for i=length(x):-1:1
  sum = sum + x(i)
end
