Clear Filters
Clear Filters

how to select function output in ode solver

1 view (last 30 days)
Robert
Robert on 20 Mar 2015
Hi everyone,
I have a function that returns a (3xN ) matrix in which each column corresponds to three coupled differential equations which i want to solve using an ode solver, how do i extract each column of the output of the function separately so I can run N ode solvers to solve each of the equations? Ive tried the below where g is my function and ret is the (3xN) output matrix from the function g?
for j=1:N
[t,x] = ode45(@g((ret(1,N),ret(2,N),ret(3,N))),tspan,x0);
end
thanks

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!