필터 지우기
필터 지우기

Setting initial condition of simulink integrator through code

조회 수: 29 (최근 30일)
Ahmed Rehan
Ahmed Rehan 2020년 7월 21일
댓글: Fangjun Jiang 2020년 7월 24일
Hi,
I am trying to cchange the initial condition of an integrator in Simulink by using Matlab code. I am using the following lines:
init_cond_integrator=[pi/3;0];
set_param('ClosedLoop_PID_MRFT_with_actuator/Manipulator Dynamics/Integrator1','InitialCondition',num2str(init_cond_integrator));
It gives the following error:
'ClosedLoop_PID_MRFT_with_actuator/Manipulator Dynamics/Integrator1' has unapplied changes. Please apply or cancel these changes before running the simulation.
Any help will be highly appreciated.
Thanks!

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 7월 21일
The error message says you have the dialog window open and changes have not been applied. Click apply or Ok and then proceed.
  댓글 수: 4
Ahmed Rehan
Ahmed Rehan 2020년 7월 24일
Yes, right, but that seems undoable using the set_param command.
Fangjun Jiang
Fangjun Jiang 2020년 7월 24일
set_param(Block,'InitialCondition',mat2str([1,2]))

댓글을 달려면 로그인하십시오.

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by