Effacer les filtres
Effacer les filtres

How to insert a time varying matrix in simulink?

31 vues (au cours des 30 derniers jours)
Linee Teh
Linee Teh le 23 Avr 2020
Commenté : Ameer Hamza le 26 Avr 2020
The figure below is my state-space equation where input matrix B and gain K are with size 9x6x100 and 6x9x100. The values of B and K are taken from the workspace in my matlab coding.
How can I assign the value of B and K into the system one by one?
For example, used B(9x6x1) & K(6x9x1) then B(9x6x2) & K(6x9x2) then B(9x6x3) & K(6x9x3) until B(9x6x100) & K(6x9x100).
I am really looking for help and thank you very much!
  2 commentaires
Ameer Hamza
Ameer Hamza le 23 Avr 2020
After how much simulation time do you want to move to the next matrix?
Linee Teh
Linee Teh le 24 Avr 2020
Let say for t = 0:1:100s, mean that the system will have different B & K every second.

Connectez-vous pour commenter.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 24 Avr 2020
The attached file (saved in R2020a) shows an easy way to import a time-varying matrix in such a way. Define the matrices in base workspace by running these lines
B = rand(9,6,100);
K = rand(6,9,100);
  24 commentaires
Linee Teh
Linee Teh le 26 Avr 2020
Thank you once again!!!
Ameer Hamza
Ameer Hamza le 26 Avr 2020
Glad to be of help.

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Simulink Functions dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by