Solve the differential equation numerically using matlab

답변 (1개)

Torsten
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
Ahamed Zajith 2015년 8월 31일
편집: Ahamed Zajith 2015년 8월 31일
Thank you sir. but i am a beginner,have an alternative methods for this ?
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?
thank you, i need a code without using ode function sir
If you have the symbolic toolbox then
dsolve('Dy=2*x*y', 'x')
its great.Thank you sir.
... but this is not a numerical solution.
Best wishes
Torsten.
For some reason what runs through my mind is the classic, "So nail it to a wall then."

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

질문:

2015년 8월 31일

댓글:

2015년 8월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by