数学实验matlab问题

img


clear;
close;
g=9.8;L=150;m=70;k=10;c0=0.00324;
fun=@(t,y)[y(2);-c0sign(y(2))y(2)^2-k/m(y(1)-L)(y(1)>L+g)];
[t,x]=ode45(fun,[0 5.998 11.18 11.47],[0;0]);
d2x=-c0sign(x(3,2))x(3,2)^2-k/m(x(3,1)-L)(x(3,1)>L)+g
[t,x]=ode45(fun,[0 30],[0;0]);
d2x=-c0sign(x(:,2)).x(:,2).^2-k/m(x(:,1)-L).(x(:,1)>L)+g;
subplot(1,3,1);plot(t,x(:,1));title('位移')
subplot(1,3,2);plot(t,x(:,2));title('速度')
subplot(1,3,3);plot(t,d2x);title('加速度')
max(x(:,1)),min(d2x)
我的程序运行不对,求问问题在哪怎么改