How to pass an input value to a Simulink block from M-file?
31 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kamran Awan
am 19 Okt. 2022
Kommentiert: Kamran Awan
am 22 Okt. 2022
Hi I'm tring to run a simulink model from M-file using 'sim' command. The simulink model needs some input values, that I'm try to pass from M-file code. But I'm not able to do it. Can anyone help me with this?
I've attached the pictures of M-file code, Simulink Model and error I get.
0 Kommentare
Akzeptierte Antwort
Benjamin Thompson
am 19 Okt. 2022
Your M file can put the data into the base workspace as a variable with a known name. Then your Simulink model can use the From Workspace source block to use it if the data is time based. Or if the data is constant use the constant source block and put the name of your base workspace variable in there.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!