Borrar filtros
Borrar filtros

Solving an equation with symbolic matrix

5 visualizaciones (últimos 30 días)
Juan Ignacio Peña
Juan Ignacio Peña el 20 de Feb. de 2024
Editada: Torsten el 20 de Feb. de 2024
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

Respuestas (1)

Torsten
Torsten el 20 de Feb. de 2024
  4 comentarios
Juan Ignacio Peña
Juan Ignacio Peña el 20 de Feb. de 2024
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 el 20 de Feb. de 2024
Editada: Torsten el 20 de Feb. de 2024
Ok, then it doesn't seem possible in MATLAB.

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Variables, Expressions, Functions, and Preferences en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by