Matthew2005
Specifier/Regulator
- Jul 31, 2005
- 1
% How do I call sumX in ode45 where I can pass in 'ab' paramter? x & y are part of the ODE problems
% tspan=[0 20] initial value: [0 1] options []
[T Y]=ode45(@sumX,[0 10],[0 1],[]);
% sumX.m
function dy=sumX(ab,x,y)
dy1=y(2);
dy2=-y(1)+ab*(y(1)^2);
dy=[dy1; dy2];
%%%%%%%%%%%%%%%
Thanks
% tspan=[0 20] initial value: [0 1] options []
[T Y]=ode45(@sumX,[0 10],[0 1],[]);
% sumX.m
function dy=sumX(ab,x,y)
dy1=y(2);
dy2=-y(1)+ab*(y(1)^2);
dy=[dy1; dy2];
%%%%%%%%%%%%%%%
Thanks