anonymous function in ode45: column vector error
古いコメントを表示
To solve ODE below with matlab

t = 0:.01:20;
x0 = [0 0]';
xdot = @(t,x) [0 1; 0 0] * x;
ode45(@(t,x) xdot(x(1), x(2)),t,x0)
I get this error:
Error using odearguments (line 91) @(T,X)XDOT(X(1),X(2)) must return a column vector.
Cloud anyone help me to solve solve 2nd order ODEs using only anonymous function definition?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!