I'm attempting to write my own deconvolution function in MATLAB, but am not sure my math is right. Can anyone assist?

Attempting to determine x(n) given $$ h(n) = (1/2)^n , 0<= n <=4$$ and 0, elsewhere. Output sequence y(n) is {1, 2, 2.5, 3, 3, 3, 2, 1, 0}

My attempt was to write the convolving vector as a 9x9 matrix and divide the output, y(n), by the inverse of h(n)... but I don't think I am getting the correct answer.

h\_n=[1 1/2 1/4 1/8 1/16 0 0 0 0; 0 1 1/2 1/4 1/8 1/16 0 0 0; 0 0 1 ...

1/2 1/4 1/8 1/16 0 0; 0 0 0 1 1/2 1/4 1/8 1/16 0; 0 0 0 0 1 1/2 ...

1/4 1/8 1/16; 1/16 0 0 0 0 1 1/2 1/4 1/8; 1/8 1/16 0 0 0 0 1 1/2 ...

1/4; 1/4 1/8 1/16 0 0 0 0 1 1/2; 1/2 1/4 1/8 1/16 0 0 0 0 1];

y\_n=[1 2 2.5 3 3 3 2 1 0];

x\_n = y\_n/h\_n^(-1);