Why am I getting a wrong matrix inverse when using a Math Function block set to 'pow' in Simulink?

2 Ansichten (letzte 30 Tage)
I want to calculate a matrix inverse in Simulink. For example, for matrix A = [4 0; 0 16]. I am using a Math Function block set to 'pow' to do the inverse. However, I get erroneous result as below:
A^-1 = [0.25 inf; inf 0.0625]
rather than
A^-1 = [0.25 0; 0 0.0625]

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 15 Dez. 2017
Using the Math Function block set to 'pow' to do the inverse operation does the element-wise inverse rather than inverting the whole matrix. To carry out a matrix inverse, please follow the steps below:
  1. Add a Product block into the model
  2. Double click on the block
  3. Under 'Number of inputs' section replace the number '2' with the right-matrix division symbol ' / '
  4. Select 'Multiplication' as 'Matrix(*)'
This will return the matrix inverse.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by