フィルターのクリア

Solving an equation with symbolic matrix

5 ビュー (過去 30 日間)
Juan Ignacio Peña
Juan Ignacio Peña 2024 年 2 月 20 日
編集済み: Torsten 2024 年 2 月 20 日
I've tried solving eq1 in the following program.
The right answer is w = -D*lambda*unos
%start
unos=ones(2,1)
unos = 2×1
1 1
ceros=zeros(2,1)
ceros = 2×1
0 0
E = symmatrix('E',2)
E = 
D=inv(E)
D = 
w=symmatrix('w',[2,1])
w = 
eq1= w + D*lambda*unos==ceros
Unrecognized function or variable 'lambda'.
solve(eq1,w)
%end
The right answer is w = -D*lambda*unos
But instead, I get the following message:
Check for incorrect argument data type or missing argument in call to function 'solve'.
Please help

回答 (1 件)

Torsten
Torsten 2024 年 2 月 20 日
  4 件のコメント
Juan Ignacio Peña
Juan Ignacio Peña 2024 年 2 月 20 日
Thank you, Torsten. I am interested in working with matrices as whole variables. I mean, considering matrices or vectors of generic size and with given assumptions (like symmetric, positive definite, etc), but without knowing the exact dimensions and elements. In my example, D is the inverse of a symmetric matrix, and I'm looking for the answer in terms of the matrix and not its elements.
As far as I understand, symmatrix2sym(D) converts a symbolic matrix variable D to an array of symbolic scalar variables S. I'm not interested in the elements of D. I am interested in working with D as a specific variable (of any dimension).
Torsten
Torsten 2024 年 2 月 20 日
編集済み: Torsten 2024 年 2 月 20 日
Ok, then it doesn't seem possible in MATLAB.

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

カテゴリ

Help Center および File ExchangeSymbolic Variables, Expressions, Functions, and Preferences についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by