matlab 二阶微分方程 求解答:1、建立微分方程的自定义函数,odefun(容x,y)2、当a=10、θ=π/6时,执行下列代码 theta=pi/6;[x,y]= ode45(@odefun,[0,0.18],[0.5,theta])plot(x,y),grid on legend('y (x)','y’(x)')xlabel('x'),ylabel('y (x),y’(x)')figure(2)plot(y(:,1),y(:,2))...
matlab里ode45解决二阶常系数微分方程用法答:plot(t,y(:,1))2、function test()[t,y]=ode45(@func1, [0,1], [0;0;1;2;2;2]);figure(1);clf;plot(t, y);legend('x','y','z','dx','dy','dz');grid on;function f=func1(t,x)r=(x(1)^2+x(2)^2+x(3)^2)^(1/2);f=[x(4); x(5); x(6); r*...