求用matlab解下面这个方程并绘图其中,epsilon=[0.01,0.001]

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 23:18:46
求用matlab解下面这个方程并绘图其中,epsilon=[0.01,0.001]求用matlab解下面这个方程并绘图其中,epsilon=[0.01,0.001]求用matlab解下面这个方程并绘图

求用matlab解下面这个方程并绘图其中,epsilon=[0.01,0.001]
求用matlab解下面这个方程并绘图

其中,epsilon=[0.01,0.001]

求用matlab解下面这个方程并绘图其中,epsilon=[0.01,0.001]
参考代码:
E=[0.01,0.001];
clf,hold on
for e = E
    dy = @(t,y)[y(2); e*y(2)^3-y(1)];
    [t,y] = ode45(dy,[0 100],[1; 0]);
    plot(t,y(:,1),'color',rand(1,3))
end
legend(arrayfun(@(e){sprintf('\\epsilon = %g',e)},E),0)