Now, my homework problem asks me to reduce the two second-order ode's to a system of first order ode's then write a script to solve the trajectory (i.e. x and y) for the first 5 seconds using the Matlab built-in function ode45.

To reduce the two 2nd order odes i set for the first ode x=x1 and dx/dt=x2 and for second ode y=y1 and dy/dt=y2 to get the system of first order ode's:

Now, my homework problem asks me to reduce the two second-order ode's to a system of first order ode's then write a script to solve the trajectory (i.e. x and y) for the first 5 seconds using the Matlab built-in function ode45.

To reduce the two 2nd order odes i set for the first ode x=x1 and dx/dt=x2 and for second ode y=y1 and dy/dt=y2 to get the system of first order ode's:

I just copied [t xy] = ode45('trajxy',0,5,[0 134 0 0]) in there right after it but yeah it isn't in the derivative file. After i run the derivative file i get the error. Then when i put [t xy] = ode45('trajxy',0,5,[0 134 0 0]) in the command window it still works but I dont seem to get right values.

I just copied [t xy] = ode45('trajxy',0,5,[0 134 0 0]) in there right after it but yeah it isn't in the derivative file. After i run the derivative file i get the error. Then when i put [t xy] = ode45('trajxy',0,5,[0 134 0 0]) in the command window it still works but I dont seem to get right values.

Try making the initial state a column vector (I don't think this matters but we might as well be consistent).

You also might be better off using a function handle rather than the function name in quotes (again I don't think this will make any difference IIRC quoted function names still work):