How to use quiver ?

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
Ismail Laabdi on 22 Jan 2015
Edited: Ismail Laabdi on 22 Jan 2015

0 votes

Hi Star Strider,
Thank you for your answer but the result is not what I wish. In fact what I want is to draw the vector field and when I try your code this is the result that I have
and me I would like a result like that
Asma Mahmood
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

Asked:

on 22 Jan 2015

Commented:

on 10 Jan 2019

Community Treasure Hunt

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

Start Hunting!