Info
This question is closed. Reopen it to edit or answer.
Error using - Matrix dimensions must agree. Error in odefcn line 4 dydt2 = diffdiffheavisidet*k^2*t^2-6*k*t*diffheavisidet 12*heavisidet-6*k*t*y1 1
1 view (last 30 days)
Show older comments
Hi, cant solve non-linear equation system, please help.
function dydt = odefcn(t,y,k)
dydt = zeros(2,1);
dydt(1) = y(2);
dydt(2) = (diff(diff(heaviside(t)))*k^2*t^2-6*k*t*diff(heaviside(t))+12*(heaviside(t))-(6*k*t*y(1)+12*y))/k^2*t^2;
k = 1;
tspan = [0 5];
y0 = [0 0];
[t,y] = ode45(@(t,y) odefcn(t,y,k), tspan, y0);
plot(t,y(:,1),'-o',t,y(:,2),'-.')
1 Comment
madhan ravi
on 8 Dec 2018
When you differentiate number of elements deduce so uploading the latex form of the equation would help.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!