How can I save internal variable to a vector with ode45.

1 Ansicht (letzte 30 Tage)
Foufa.h
Foufa.h am 9 Apr. 2017
Kommentiert: Jan am 9 Apr. 2017
function [dx]= system(t,x)
global m I
F= expression;
u=F+alpha*u(t-1);
dx(1)=x(2);
dx(2)=m*x(1)+u/I;
dx(3)=-m*x(1)-u/I;
dx=[dx(1);dx(2);dx(3)]';
end
[time,Xs]=ode45(@system(t,x),[0:0.1: 7],x01)
x01=[0.05 0.05 0 ]'
I want to save u , and use it to have u(t-1)
  2 Kommentare
Stephen23
Stephen23 am 9 Apr. 2017
Use a nested function.
Jan
Jan am 9 Apr. 2017
How should this work at the initial t?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by