How to use run-time tunable parameter for Constant Volume Chamber (G)
조회 수: 3 (최근 30일)
이전 댓글 표시
When you use e.g. a DoubleActing Actuator (IL) in Simulink/SimScape, you can select that the initial position displacement parameter should be run-time tunable from a dropdown menu, instead of compile-time tunable.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1377709/image.png)
How can you make a parameter for the initial pressure of the gas to be run-time tunable for a "Constant Volume Chamber (G)"?
Here the there is no option to change from compile-time to run-time.
Exported c++ code has this value hardcoded according to the current value of the parameter in the Workspace.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1377714/image.png)
댓글 수: 1
Yifeng Tang
2023년 5월 10일
I think it's do-able. Try this first: make this InitialPressure a Simulink Parameter in the Model Workspace, instead of MATLAB base workspace variable. Will you see it available in the generated code, instead of hard-coded?
답변 (1개)
Akshat Dalal
2023년 9월 7일
Hi Stian,
I understand you would like to make some of the block parameters run-time tunable. You could refer to the following documentations for the same:
- https://in.mathworks.com/help/releases/R2021a/sldrt/ug/tune-block-parameters-and-matlab-variables.html
- https://in.mathworks.com/help/simscape/ug/specify-and-change-a-run-time-configurable-parameter.html
Hope this helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Run-Time Parameters에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!