MATLAB: Plot a second order equation and plot two equations on the same grafic

plot equationsplot two equations;second order equations

Hi everyone,
1. I can't plot this function in a grafic, I think the code in the editor is not right. The second order equation is:
(a) dx^2/dt^2 (t) = -xg0*w0^2*sin(wf*t)-w0^2*x-2*M*w0*beta*dx/dt
xg0, w0, M, beta are constants.
2. Plot two solutions in the same grafic.
I already solve other system with ode45, now i want to plot that second order equation with one solution of this sistem.
It is a enginneering problem that consist in a structure with and without a vibration control system. One equation (a) give me the response without that control and the system of equations give me the response with that control… I need to compare that in the same grafic.
Thank's everyone.

Best Answer

You can plot multiple sets of data on one figure multiple ways. The first way would be:
plot(x1,y1,x2,y2,...)
The next most common would involve using hold:
plot(x1,y1)
hold on
plot(x2,y2)