Error using odearguments (line 93) PHASE_1 must return a column vector.
Show older comments
Here is my call to ode45
[t,y] = ode45(@Phase_1, tspan, intial_conditions);
and here is the function i am referencing
function dydt = Phase_1(t, y)
dydt(1,1) = y(3);
dydt(1,2) = y(4);
dydt(1,3) = 2*t;
dydt(1,4) = 1.5*t;
dydt(1,5) = t^(1/9);
dydt(1,6) = t^(1/6);
end
when I call ode45 I get these error messages and I can't seem to figure out what I'm doing wrong. Any help would be much appreciated.
Error using odearguments (line 93)
PHASE_1 must return a column vector.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in rocket_code (line 32)
[t,y] = ode45(@Phase_1, tspan, intial_conditions);
Accepted Answer
More Answers (1)
Walter Roberson
on 16 May 2019
0 votes
dydt(1,6) is column 6 of row 1. You are creating a row vector of output values. The ode* routines require that the function creates a column vector, not a row vector.
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!