I have the following code trying to solve differential equation of second order:
[t,X] = ode45(@(t,X) odefun_4(t,X,u), [0 10], [0;0]);
function dx = odefun_4(t,x,u)
m = 15;
b = 0.2;
k = 2;
dx = [x(2); u/m - (b/m)*x(2) - (k/m)*x(1)];
Vector u is a 1x100 vector. I expect to get a 2x100 matrix as the return value. What am I doing wrong ?