In this line:
you are using xy(4) before it is defined. That is, you have t'' defined in terms of another highest order term x'' that has no value assigned to it yet. You can't do that.
To use ode45( ) on this, you first need to solve your equations for the highest order derivatives. I.e., you need to have equations that look like this:
t'' = stuff that is known
x'' = stuff that is known
Then code up your derivative function from these equations.
It looks like you could solve that 2nd equation for x'' first, evaluate it, and then use the x'' result to plug into the t'' equation.