Hello,

I try to implement the problem as follows. Φ,Q are my variables and both are NxN diagonal matrices

My Matlab code is shown as below:

However, the result is not as expected. I think maybe something wrong in my code.

Can anyone tell me that my code is correct or not? Thank you!