Convert m-code into state space block

3 vues (au cours des 30 derniers jours)
JGP
JGP le 10 Août 2023
Commenté : JGP le 10 Août 2023
I'm trying to convert a feedback control system that I've implemented in M-code into a Simulink model.
In the code, I used the 'ss' function and 'lsim' to obtain results.
However, even though I input the same state equations and control inputs, the results diverged when using a state-space block in the Simulink model.
I'm wondering if anyone has experienced a similar issue and if I could get some assistance with this. Have you ever encountered a situation like this?
  2 commentaires
Sam Chak
Sam Chak le 10 Août 2023
Could you please attach the m-file by clicking on the paperclip icon ?
Alternatively, you can copy and paste the MATLAB code. Click on this icon to enable the Code mode (grey field).
paste the code
JGP
JGP le 10 Août 2023
Actually, I resolved the issue by reconfiguring the sampling time.
Thank you so much.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Dynamic System Models dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by