MATLAB: Too many input arguments, which arguments should I remove

for-loop ode45

Hi all, on the attached code, I am trying to use a for-loop and ode45 to solve odes and an algebraic equation in 31 iterations. However, I get an error message
Error using my_odesloop>odes
Too many input arguments.
Error in my_odesloop>@(t,y)odes(t,y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) (line 46)
sol(j) = ode45(@(t,y) odes(t,y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),t,y0);
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in my_odesloop (line 46)
sol(j) = ode45(@(t,y) odes(t,y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),t,y0);
I don't know which arguments to remove.
Please help.

Best Answer

Your function line for odes needs to list A, B, C, and so on.