Solving differential equation using ode45 in a single file
6 ビュー (過去 30 日間)
古いコメントを表示
Hello
I need to solve the following ODE using ode45 function:
dy/dx=(y/x)-(y/x)^2, in interval 1<=x<=2, and initial condition of y(1)=1
I am struggling with creating a script in a single file without using a separate function file. I thought this would work but it gives an error:
[x,y]=ode45(@deriv, [1,2],1);
function dydx=deriv(x,y)
dydx=(y/x)-(y/x)^2
Any help would be appreciated.
Thanks
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!