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!