Phase plane of a differential system

6 ビュー (過去 30 日間)
abc abc
abc abc 2015 年 5 月 5 日
コメント済み: Star Strider 2015 年 5 月 6 日
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 !!!

採用された回答

Star Strider
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.
See the documentation on Array vs. Matrix Operations for details on the differences.

その他の回答 (1 件)

abc abc
abc abc 2015 年 5 月 6 日
thank you very much it works :)
  1 件のコメント
Star Strider
Star Strider 2015 年 5 月 6 日
My pleasure!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by