![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261403/image.png)
My quiver plot seems to go flat when I am plotting a coupled ode.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
So the ODE system reads:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/260276/image.png)
and my code reads:
[x, y]=meshgrid(-2:0.6:4)
dx = 3*(x-1)*y;
dy = 2-x-y^2;
quiver(x, y, dx, dy, 'r')
startx = -5:0.9:5;
starty = -2:0.6:5;
streamline(x,y,dx,dy,startx,starty)
Which Gives:
![quiver.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/260277/quiver.png)
I'm a bit stuck because this is the plot I am supposed to get:
![222.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/260278/222.png)
0 Kommentare
Antworten (1)
Asvin Kumar
am 13 Jan. 2020
I believe, while trying to compute dx and dy, you intended to find the elementwise product using the matrices of x and y. Try the following code instead with changes in lines 2 & 3.
[x, y]=meshgrid(-2:0.6:4)
dx = 3*(x-1).*y;
dy = 2-x-y.^2;
quiver(x, y, dx, dy, 'r', 'AutoScaleFactor', 2)
startx = -5:0.9:5;
starty = -2:0.6:5;
streamline(x,y,dx,dy,startx,starty)
Modify the property ‘AutoScaleFactor’ to change the size of the arrows.
The code given above should produce the following output.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261403/image.png)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Vector Fields finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!