How to run simulink simulation for different inputs programatically

조회 수: 8 (최근 30일)
Ranjith Prakash
Ranjith Prakash 2022년 5월 25일
답변: Fabio 2022년 5월 25일
I need to know how can i run one simulink model from matlab code where i can give a input as vector and feed that input to simulink model

답변 (1개)

Fabio
Fabio 2022년 5월 25일
Hi,
You can use the Simulink.SimulationInput class to set the model you want to simulate and the inputs to use (see setExternalInput method).
Then, to run the simulation, you only need to call the sim function with the Simulink.SimulationInput object as argument.
If you use an array of Simulink.SimulationInput objects, the sim function run all the simulations and store the outputs in an array of Simulink.SimulationOutput objects.
I hope this can help you.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by