Solving the following equation without taking inverse.
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How to solve the following equation for calculating the D:
D=|inv(B)|∗|g|
here, B is a non-singular square matrix and g is a column vector of the length equal to the no of elements in the row of B. Modules is applied element-wise.
The solution of this without taking the inverse.
5 comentarios
Walter Roberson
el 25 de Mzo. de 2022
If it were not for the
part of the
then with singular matrices you would typically switch to using
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/941419/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/941424/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/941429/image.png)
What is the mathematical situation that leads you to want to have the
part? And would using
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/941434/image.png)
D = abs(pinv(B)) * abs(g)
be acceptable for your situation?
Respuestas (1)
Chunru
el 25 de Mzo. de 2022
In matlab, you can solve the linear system by mldivide or \
"doc mldivide" for detailed description.
B= randn(4, 4)
g = randn(4, 1)
f = B \ g
B * f
1 comentario
Walter Roberson
el 25 de Mzo. de 2022
Notice in the original question,
Modules is applied element-wise
That is, the
we see is absolute value of each element of g, and the
is absolute value of each element of the inverse of B.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/940739/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/940744/image.png)
It is easy enough in your code to use B\abs(g) so there is no concern about the
part. But the MATLAB \ operator does not take absolute value of the inverse, and there is no option to force it to.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/940749/image.png)
This feels like a constrained least squares. I wonder if https://www.mathworks.com/help/matlab/ref/lsqnonneg.html can be used?
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!