dsolve(diff(X,t) not working for 3x3 matrix

조회 수: 2 (최근 30일)
chen tianle
chen tianle 2021년 9월 28일
댓글: Walter Roberson 2021년 9월 28일
the following code not working for 3x3 matrix , can only work for 2x2 , please help what is the error for solving 3 x3 ?
A=[ -0.12 0.05 0.05 ;0.1 -0.1 0; 0.02 0.05 -0.05 ]
syms x
syms x(t) y(t);
X = [x; y; b];
b = 0;
[Sx, Sy, Sz] = dsolve(diff(X,t) == A*X + b)

답변 (1개)

Walter Roberson
Walter Roberson 2021년 9월 28일
A=[ -0.12 0.05 0.05 ;0.1 -0.1 0; 0.02 0.05 -0.05 ]
A = 3×3
-0.1200 0.0500 0.0500 0.1000 -0.1000 0 0.0200 0.0500 -0.0500
syms x
syms x(t) y(t) z(t);
b = 0;
X = [x; y; z];
eqn = diff(X,t) == A*X + b
eqn(t) = 
[Sx, Sy, Sz] = dsolve(eqn)
Sx = 
Sy = 
Sz = 
  댓글 수: 2
chen tianle
chen tianle 2021년 9월 28일
hi can got it , but how you change your answer to this style? i feel is better to see and read ..
my is only one line , how change to your format in matlab ?
Walter Roberson
Walter Roberson 2021년 9월 28일
I ran the code right here in MATLAB Answers, which uses Livescript . Livescript automatically formats symbolic expressions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by