How to use function "setBlockParameter" to set the parameter of Simulink block "prismatic joint"?

"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.
But there is indeed a parameter called as above.
So .....

 Respuesta aceptada

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 comentarios

You are able to get a full list of all block parameters with the command
BlockParameterNames = fieldnames(get_param('<block path/name>','ObjectParameters'))
% ^
% Insert your own block path/name here
I see, thank so much for your help!
I'm glad I could help! Thank you for an interesting question.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simscape Multibody en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Abr. de 2021

Comentada:

el 24 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by