Divide a matrix - How to do that in MATLAB?

123 Views Asked by At

I want to write out this formula

$$P = P - P\phi(I+\phi^TP\phi)^{-1}\phi^TP$$

I tried this matlab code:

P = P - P*phi*inv(I + phi'*P*phi)*phi'*P;

But it didn't work.

Then I tried this and it work.

P = P - (P*phi*phi'*P)/(I + phi'*P*phi);

The dimensions are following:

$P\in \Re^{nxn},$ $\phi\in \Re^{nx1},$ $\theta\in \Re^{nx1}$

So what is the right interpretation to the formula?

If you wonder what formula it is. Have a look at equation 5 in this document:

Recursive Least Square

Or equation 2.17 in this document, page 51:

Adaptive Control

1

There are 1 best solutions below

0
On BEST ANSWER

Try this:

q = [2, 4; 6, 8] * inv([1, 2; 3, 4]

Where inv is the inverse function, q is the new matrice, and the two matrices are what matrices is left division going to happen upon.