The second input to coder.internal.reallocDynamicMatrix must be indexInt.
Afficher commentaires plus anciens
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
Réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!