error in ode45 – function must return a column vector
I’m trying to get matlab to solve at plot solution lines on top of my slope field. But it just keeps telling me that my function doesn’t return a column vector.
I have tried doing the transpose f = f(:); but still doesn’t work
this is my code.
f = @(t,y) (3880 – 0.817*y + (731000*y.^7.88)/(116000.^7.88 + y.^7.88));
dirfield(f,0:10:100,0:1000:10000);
hold on;
y0 = 0:100:8000;
f = f(:);
[ts,ys] = ode45(f,[0,50],y0);
plot(ts,ys);
hold offI’m trying to get matlab to solve at plot solution lines on top of my slope field. But it just keeps telling me that my function doesn’t return a column vector.
I have tried doing the transpose f = f(:); but still doesn’t work
this is my code.
f = @(t,y) (3880 – 0.817*y + (731000*y.^7.88)/(116000.^7.88 + y.^7.88));
dirfield(f,0:10:100,0:1000:10000);
hold on;
y0 = 0:100:8000;
f = f(:);
[ts,ys] = ode45(f,[0,50],y0);
plot(ts,ys);
hold off I’m trying to get matlab to solve at plot solution lines on top of my slope field. But it just keeps telling me that my function doesn’t return a column vector.
I have tried doing the transpose f = f(:); but still doesn’t work
this is my code.
f = @(t,y) (3880 – 0.817*y + (731000*y.^7.88)/(116000.^7.88 + y.^7.88));
dirfield(f,0:10:100,0:1000:10000);
hold on;
y0 = 0:100:8000;
f = f(:);
[ts,ys] = ode45(f,[0,50],y0);
plot(ts,ys);
hold off ode45, ode45error, error, function, ode, ode23, odeargument MATLAB Answers — New Questions