Two things.
1: you're breaking out of the loop immediately by using the break keyword.
2: you're not addressing the output as a vector, so TempUpdated is just a scalar that's overwritten repeatedly.
The loop isn't necessary, but whatever it is that you're trying to do isn't what the math gives.
Tempxy = [0:0.125:2;10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30];
% this does the same thing as your code
TempUpdated = (Tempxy(2,3:end) + Tempxy(2,1:end-2))./2
% maybe?
TempUpdated = [Tempxy(2,1) (Tempxy(2,3:end) + Tempxy(2,1:end-2))./2 Tempxy(2,end)]
% or maybe?
TempUpdated = movmean(Tempxy(2,[1:end end]),2)
