Error using Solve with symmatrix equation
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Christoph Feldkircher
am 24 Feb. 2023
Kommentiert: Christoph Feldkircher
am 24 Feb. 2023
Hi I'm trying to find the general symbolic solution to the following matrix equation:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1305430/image.png)
I tried the following code:
A = symmatrix('A', [3 3]);
H = symmatrix('H', [3 3]);
L = eye(3,3) - A;
sol = solve(A + 1/2*L^2 - 1/6*L^3 - H==zeros(3,3), A);
It gives me the following error: Incorrect number or types of inputs or outputs for function 'solve'. Could somebody give me a hint what I need to change? Thank you for any help in advance!
0 Kommentare
Akzeptierte Antwort
Askic V
am 24 Feb. 2023
The function solve doesn'tsupport symmatrix. One way to solve matrix equeation is the follwoing:
A_r = [3 -6; 5 2];
B_r = [7 4; -5 8];
X_r = 2*B_r-3*A_r
% solve symbolically
A = sym('a', [2 2]);
B = sym('b', [2 2]);
X = sym('x', [2 2]);
sol = solve(3*A+X-2*B == zeros(2,2), X);
[sol.x1_1, sol.x1_2; sol.x2_1, sol.x2_2]
Since you have matrices 3x3 with power to 3, you need to be prepared to wait a long time.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!