How to add arrows to the phase plane produced ?
조회 수: 11 (최근 30일)
이전 댓글 표시
I have the following matlab code that produces the phase plane for the state variables and I want to add arrows in order to show that my system goes from the initial conditions point to the stability point which is (0,0). How is that possible ?
tspan = 0.0:0.1:10;
[t,w] = ode45(@ode, tspan, [-0.5;-0.5]);
plot(w(:,1),w(:,2))
function dx = ode(t,x)
dx = [x(2) ; - x(2) - 4*x(1)];
end
댓글 수: 0
채택된 답변
KSSV
2018년 11월 30일
tspan = 0.0:0.1:10;
[t,w] = ode45(@ode, tspan, [-0.5;-0.5]);
plot(w(:,1),w(:,2))
hold on
quiver(w(:,1),w(:,2),gradient(w(:,1)),gradient(w(:,2)))
end
function dx = ode(t,x)
dx = [x(2) ; - x(2) - 4*x(1)];
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!