Mean square

Can you fill this square so that the number in the middle of each line is the mean of the two numbers on either side of it?

Problem



Can you fill this 3 by 3 grid with the numbers 1 to 9, so that the number in the middle of each line (horizontal, vertical and diagonal) is the mean of the two numbers on either side of it?
  

Image
Mean Square