フィルターのクリア

I want to draw dual phase portraits in a 4x4 linear differential equation system. My codes contain 4 variables as below (x1, x2, y1, y2).

2 ビュー (過去 30 日間)
p=0.1; q=15;
x1dom = linspace(-p,p,q);x2dom = linspace(-p,p,q);y1dom = linspace(-p,p,q);y2dom = linspace(-p,p,q);
[X1,X2,Y1,Y2] = ndgrid(x1dom,x2dom,y1dom,y2dom);
A=[1.1 0 0.8 0 ; 0 1.2 0 0 ; 0 0 -0.9 0 ; 0 0 0 -0.5];
X1dot= A(1,1)*X1 + A(1,2)*X2 + A(1,3)*Y1 + A(1,4)*Y2;
X2dot= A(2,1)*X1 + A(2,2)*X2 + A(2,3)*Y1 + A(2,4)*Y2;
Y1dot= A(3,1)*X1 + A(3,2)*X2 + A(3,3)*Y1 + A(3,4)*Y2;
Y2dot= A(4,1)*X1 + A(4,2)*X2 + A(4,3)*Y1 + A(4,4)*Y2;
quiver(X1,X2,X1dot,X2dot)
Error using matlab.graphics.chart.primitive.Quiver/set
Error setting property 'XData' of class 'Quiver':
Value must be an array of numeric type with 3 or fewer dimensions.

Error in quiver (line 81)
set(h,'Parent',parax,'Color_I',c,'LineStyle_I',ls,pvpairs{:});
How could I solve this problem?
  2 件のコメント
Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2021 年 9 月 12 日
your X1 , X2 , X1dot , X2dot are 4 dimensional array. how do you want to plot them with quiver? it is exactly the error the code returns.
"Value must be an array of numeric type with 3 or fewer dimensions."
kadir can erbas
kadir can erbas 2021 年 9 月 13 日
編集済み: kadir can erbas 2021 年 9 月 13 日
I noticed it later. When I write a 2D array in the Quiver function, the problem is fixed.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by