I am trying to solve an ODE using ode45 as
[eta_ode_i, fg_ode_i] = ode45(@UVWTI,eta,FI,options);
My function however depends parametrically on a precalculated array as follows
function [dfi]=UVWTI(t,fi)
dfi=zeros(7,1);
dfi(1)=A11(t)*fi(1)+A12(t)*fi(2)+A13(t)*fi(3)+A14(t)*fi(4)+A15(t)*fi(5)+A16(t)*fi(6)+A17(t)*fi(7);
...
dfi(7)=similar
end
A11, A12, etc are arrays with a length say K. However, since I don't know in advance what t is ode45 going to take internally, it's impossible for me to know what element of A11 I should use. Shall I interpolate? Should work but I wonder if there is a simpler method.