Solving Matrix Equation in Simulink
3 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I have the following matrix euation:
Pdot=beta*P-P*(Phi*Phi'-error*H)*P
which P is a matrix with 4*4 size. I want to solve this equation in simulink.I use matlab embeded block.In every step,this equation should be solved and P is updated. what code i should write?
回答(1 个)
Mischa Kim
2014-1-13
The basic structure looks like this:

In the embedded function you compute Pdot which is inputted into an integrator that computes P. Don't forget to set initial conditions for P by opening the integrator. Assuming that all the other variables are constants the embedded function might look something like:
function Pdot = fcn(P)
beta = ...
Phi = ...
Phip = ...
error = ...
H = ...
Pdot = beta*P - P*(Phi*Phip - error*H)*P;
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!