Phase plane of a differential system
1 次查看(过去 30 天)
显示 更早的评论
Hi, i'm trying to plot a phase plane but it doesn't work :(
This is the matlab code:
clear all
clc
[X,Y] = meshgrid(0:0.2:5,0:0.2:5);
u = -((3*X)/(2+X))*(Y-X);
v = zeros(26);
figure
quiver(X,Y,u,v);
And matlab answer me: Warning: Matrix is singular to working precision.
Thank you very much for your help !!!
0 个评论
采纳的回答
Star Strider
2015-5-5
You need to do element-wise (array) operations.
Change the ‘u’ assignment to:
u = -((3*X)./(2+X)).*(Y-X);
and it works.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!