The second input to coder.internal.reallocDynamicMatrix must be indexInt.
古いコメントを表示
I want to use ode45 in matlab function(that is block of sumulink).
However, i cannot do it when i tried to use ode45 for solve second‐order differential equation.
Would you tell me how to use ode45 in matlab function?
i tried the following code.
function yout = fcn(u)
[t,y] = ode45(@vdp1,[0 20],[2; 0]);
yout = y(end,:);
end
function dydt = vdp1(t,y)
dydt = [y(2); (1-y(1)^2)*y(2)-y(1)];
end
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!