You have to supply the same number of initial conditions to the ODE solver as you have variables in your ODE equation. Assuming you only want‘x(3)’ to have anything in it at the start, this works:
[t,x]=ode45(F,[0 3], [0 0 10]);
The rest of your code is unchanged, although you might want to add this after yourplot call:
ode45 is a numerical solver. There is no need to define the symbolic variable inside the function. Also, the ODE state variable is 'y', not 'x'. Change the function definition to this
Best Answer