How to use quiver ?
Show older comments
Hi everyone
I would like to draw a vector field with the function quiver and as an input I have two vectors from the resolution of an differential equation with
function [ dxdt ] = vdp( t,x )
m=0.01;
dxdt(1)=x(2) ;
dxdt(2)=m*(1-x(1).^2)*x(2)-x(1)-10 ;
dxdt=dxdt' ; %on convertit la ligne en colonne
end
Script
[t,x]=ode45(@vdp,[0 1000],[1;1]) to solve the differential equation
plot(x( :,1),x( :,2),'b') to plot the phase portrait
But I tried to use quiver like quiver(x(:,1),x(:,2)) but it doesnt work.
Anyone have an idea about how to do that
Thanks
Answers (2)
Ismail Laabdi
on 22 Jan 2015
Edited: Ismail Laabdi
on 22 Jan 2015
0 votes
1 Comment
Asma Mahmood
on 10 Jan 2019
I also want the second one
Asma Mahmood
on 10 Jan 2019
0 votes
I want to draw a phase portrait of a system of two linear differential equatuions on matlab. How can I draw?
Categories
Find more on Vector Fields 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!
