필터 지우기
필터 지우기

How do you use the constant block as input to set the parameter value in the Cylinder block in simscape

조회 수: 1 (최근 30일)
I want to control the ‘stroke’ parameter value of the Cylinder in Injector1 in sh_diesel_injection model by the Constant block, and convert the whole model into a dynamic link library.
I set the stroke value through the Constant block and change the 'stroke' parameter value in the Cylinder block through the S-function. but it dosen't work.
set_param('sh_diesel_injection/Injector1/Cylinder','stroke', num2str(u(1))); % 'test' S-Function
I get the following error:
Cannot change parameter 'Piston stroke (stroke)' of 'sh_diesel_injection/Injector1/Cylinder' while simulation is running.
How do I solve this problem? Somebody please help me in this regard.

답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by