Solve the differential equation numerically using matlab
显示 更早的评论
回答(1 个)
Torsten
2015-8-31
fun=@(t,y)2*t*y;
Tspan = [0 2];
y0=1;
[T,Y] = ode45(fun,Tspan,y0);
plot(T,Y(:,1));
Best wishes
Torsten.
7 个评论
Ahamed Zajith
2015-8-31
编辑:Ahamed Zajith
2015-8-31
Walter Roberson
2015-8-31
That is the beginner version.
Are you asking for the "beginner" version, or are you asking for the homework version in which you need to calculate it without using the ode functions?
Ahamed Zajith
2015-8-31
Walter Roberson
2015-8-31
If you have the symbolic toolbox then
dsolve('Dy=2*x*y', 'x')
Ahamed Zajith
2015-8-31
Torsten
2015-8-31
... but this is not a numerical solution.
Best wishes
Torsten.
Walter Roberson
2015-8-31
For some reason what runs through my mind is the classic, "So nail it to a wall then."
类别
在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!