How can i insert time varying parameters in simulink block?

13 ビュー (過去 30 日間)
Davide Marzatico
Davide Marzatico 2018 年 2 月 27 日
コメント済み: faycel jamaaoui 2021 年 8 月 23 日
Hi everyone, I have a simulink model simultaing a periodic continuous system in the form: dx(t)=A(t)x(t)+B(t)u(t) with A(t+T)=A(t) and B(t+T)=B(t) In every instant i compute the matrices A(t) and B(t). I am introducing a Kalman filter, but i can't figure out how to insert variable matrices in the simulink block. What is the best way to do it? Thanks in advance for the help.

採用された回答

Sujit Muduli
Sujit Muduli 2018 年 3 月 6 日
Hi Davide,
For this use case, I would suggest creating a variable of type Simulink.Parameter in the base workspace.
x = Simulink.Parameter
x.Value = [1 1 1 ; 2 2 2];
The above will create a variable x of Simulink.Parameter where the Value field is where you want to put your matrix.
I am attaching a model where I have written a MATLAB function which updates the x.Value in each time step. You may follow this approach or you may find some other way to manipulate the x.Value in your Simulink model.
  • Create the variable x as show above. Then simulate the model and see the x.Value at the end of the simulation.
Thanks,
Sujit
  2 件のコメント
Davide Marzatico
Davide Marzatico 2018 年 3 月 7 日
Thank you for the help Sujit!
faycel jamaaoui
faycel jamaaoui 2021 年 8 月 23 日
Hello sir;
Please i need your help. I use the MATLAB Version 2015. Can you please send me the modeldemoMatrixInp.mdl version 2015.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by