How to plot a vector field?

6 ビュー (過去 30 日間)
Daniel
Daniel 2014 年 11 月 14 日
コメント済み: Star Strider 2014 年 11 月 14 日
function xp=Pr(t,x)
xp=x;
x1=x(1);
x2=x(2);
xp(1)=(x1.^2) - 312.*x1 + 6.*x2;
xp(2)=-1/2.*(x1.^2) - x1.*x2 + 292.*x1 + 144.*x2;
I'm trying to plot a vector field for this function using meshgrid and quiver and I don't manage to figure it out. Need help! Thanks!
  2 件のコメント
Andrew Reibold
Andrew Reibold 2014 年 11 月 14 日
What did you try? Did you read the documentation for meshgrid and quiver?
Also, we can't help you really with such limited information. Does xp just contain two scalar values? I have no idea what is in there because we dont' know what Pr is nor the values of t and x. There is not enough information, and no shown attempt to create a vector field.
It seems you already know which functions to try.
Star Strider
Star Strider 2014 年 11 月 14 日
I’m having problems integrating your ODE with both ode45 and ode15s. What are your initial conditions and ‘tspan’?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by