필터 지우기
필터 지우기

Pass input timeseries and block values into the sim command

조회 수: 2 (최근 30일)
Yevgeniy Gorbachev
Yevgeniy Gorbachev 2023년 2월 5일
댓글: Yevgeniy Gorbachev 2023년 2월 6일
Hi,
Is there a way to pass Simulink models inputs into the sim call as opposed to "From Workspace" blocks (for signals) or workspace-named variables (for mask parameters)?
e.g, instead of
V_in = timeseries(0:0.05:10 > 2, 0:0.05:10);
K = 10;
sim("my_simulation");
I would use something like
input_voltage = timeseries(0:0.05:10 > 2, 0:0.05:10);
motor_gain = 10;
sim("my_simulation", "V_in", input_voltage, "K", motor_gain); % (if I have blocks that expect things named V_in and K)
Thank you!

채택된 답변

Paul
Paul 2023년 2월 5일
Hi Yevgeniy
Use a Simulink.SimulationInput object. More generally start from Run Simulations and follow the doc pages from there for more details.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by