ODE45 say ' must return a column vector' with experiment data.
Show older comments
When I use ODE 45 with velocity1 [9000x1] vector , it doesn't work well.
So I have a question.
I used 'interp1' for chagning [9000x1] to [1x9000] vector.
But when i run this, it says "@(TIME,X)G(TIME,X) must return a column vector".
So when I attach interp1 into ode45 like "ode45(@(time,x) interp1(t, g(time, x),time), time, 0.003);
xa2 has only "y=0.003".
Could you help me how to solve this problem? Thank you so much.
v = interp1(time, velocity1, t1);
g = @(time, x) -abs(v)*a(4)*x(1)*abs(x(1))^(n-1)-a(5)*v*abs(x(1))^n+a(6)*v;
[time, xa2] = ode45(@(time,x) g(time, x), time, 0.003);
5 Comments
madhan ravi
on 16 Nov 2018
in the text file you attached there are 4 columns what do they represent? what are the values of time , velocity and t1 in interp1?
CHOI HYUNDUK
on 16 Nov 2018
madhan ravi
on 16 Nov 2018
in the text file there are 4 columns please mention what datas they represent
Torsten
on 16 Nov 2018
@CHOI HYUNDUK: I wonder why you can't just take the code I supplied.
The variable "time" in your call to interp1 is at the wrong position ; it has to be the last, not the first input parameter to "interp1".
CHOI HYUNDUK
on 17 Nov 2018
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations 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!