How to use function "setBlockParameter" to set the parameter of Simulink block "prismatic joint"?
2 ビュー (過去 30 日間)
古いコメントを表示
"Prismatic joint" is a block in the Simscape Multibody library. Function "setBlockParameter" is used to set parameter of a block. But it seem unable to set the parameter of such block. Here is the code and display.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595125/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595125/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595130/image.png)
But there is indeed a parameter called as above.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595135/image.png)
So .....
0 件のコメント
採用された回答
Clayton Gotberg
2021 年 4 月 24 日
I believe the issue is that the parameter name is simpler than the path you've typed. For ease of reading, a lot of the parameter names seem to be shortened and nested like in your third image. However, there is a property called 'PositionTargetValue' that I can write to in the little test sim I made. Give this a try:
in = setBlockParameter(in,'chair_exp2/PJ_ground_rail','PositionTargetValue',0.2)
3 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Assembly についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!