How to Configure Simscape Multibody Block Parameters Using MATLAB

I'm currently attempting to build Simscape Multibody models programmatically using MATLAB scripts, but I keep encountering difficulties when setting block parameters. The main challenge is that I'm unsure about the corresponding variable names and the specific naming conventions for configurable options of each parameter.
After consulting the official documentation, I understand that I can use
simscape.multibody.*
functions or directly modify block parameters using
set_param
but I cannot find a comprehensive reference table for parameter names.
I would appreciate guidance on:
  1. How to obtain a complete list of all configurable parameters for Simscape Multibody blocks
  2. For enumeration-type parameters (such as geometry shapes, joint types), what are the corresponding option names
  3. Is there a systematic approach to creating complete Simscape Multibody models through code
Thank you all for your help!

1 Comment

For a simulink block with config ur able parameters, I find that parameter names can be listed using edit MASK/ctrl+M when you click the block.

Sign in to comment.

 Accepted Answer

Hi Justina,
It does appear that the Simscape Multibody documentation is sparse to non-existent on programmatic use of block parameters (whereas base Simulink shows that on the doc page for every block, at least the pages I've checked).
Use get_param to at least get a list of the block dialog parameters, e.g., for the Brick Solid
load_system('sm_lib'); % if Simulink library browser is not already loaded.
get_param('sm_lib/Body Elements/Brick Solid','DialogParameters')
ans = struct with fields:
BrickDimensions: [1×1 struct] BrickDimensions_conf: [1×1 struct] BrickDimensionsUnits: [1×1 struct] ExportEntireGeometry: [1×1 struct] InertiaType: [1×1 struct] BasedOnType: [1×1 struct] Density: [1×1 struct] Density_conf: [1×1 struct] DensityUnits: [1×1 struct] Mass: [1×1 struct] Mass_conf: [1×1 struct] MassUnits: [1×1 struct] CenterOfMass: [1×1 struct] CenterOfMass_conf: [1×1 struct] CenterOfMassUnits: [1×1 struct] MomentsOfInertia: [1×1 struct] MomentsOfInertia_conf: [1×1 struct] MomentsOfInertiaUnits: [1×1 struct] ProductsOfInertia: [1×1 struct] ProductsOfInertia_conf: [1×1 struct] ProductsOfInertiaUnits: [1×1 struct] GraphicType: [1×1 struct] MarkerShape: [1×1 struct] MarkerSize: [1×1 struct] MarkerSize_conf: [1×1 struct] GraphicVisPropType: [1×1 struct] GraphicDiffuseColor: [1×1 struct] GraphicDiffuseColor_conf: [1×1 struct] GraphicOpacity: [1×1 struct] GraphicOpacity_conf: [1×1 struct] GraphicSpecularColor: [1×1 struct] GraphicSpecularColor_conf: [1×1 struct] GraphicAmbientColor: [1×1 struct] GraphicAmbientColor_conf: [1×1 struct] GraphicEmissiveColor: [1×1 struct] GraphicEmissiveColor_conf: [1×1 struct] GraphicShininess: [1×1 struct] GraphicShininess_conf: [1×1 struct] DoExposeReferenceFrame: [1×1 struct] SerializedFrames: [1×1 struct] BlockFunction: [1×1 struct]
Then, for example
get_param('sm_lib/Body Elements/Brick Solid','BrickDimensions') % default dimensions
ans = '[1 1 1]'
I don't know the answer to Q2. Too bad it's either not documented or very difficult to find.

1 Comment

Thanks Paul!
Your instruction is very useful. Now I can use
get_param
to get the parameters of the block that I need. Although it would take some time, given the lack of documentation, it is currently the best solution.
Thank you very much for your efforts, and I wish you all the best.

Sign in to comment.

More Answers (0)

Products

Release

R2024b

Asked:

on 9 Mar 2026 at 11:22

Edited:

on 10 Mar 2026 at 2:12

Community Treasure Hunt

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

Start Hunting!