Simscape Multibody Model from MATLAB Code

MATLAB code to build a Simscape Multibody model of a single link and a multi-link pendulum

You are now following this Submission

This file contains MATLAB code to build a Simscape Multibody model of a single link and a multi-link pendulum. MATLAB commands such as add_block, add_line, and set_param are used to add, connect blocks and set block parameter values. This technique can be used for creating models from blocks in Simscape libraries or Simscape add-on products.
To see an overview of multibody modeling in Simscape Multibody, watch this video (1.5 min): http://www.mathworks.com/videos/simmechanics-introduction-69809.html
To find other Simscape examples, search for posts with the keyword "physical modeling"
To learn more about MathWorks Simscape Products, go to:

Cite As

Steve Miller (2026). Simscape Multibody Model from MATLAB Code (https://www.mathworks.com/matlabcentral/fileexchange/45410-simscape-multibody-model-from-matlab-code), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.4.0.3

Eliminated blog

1.4.0.2

Updated to accommodate changes to Simscape Multibody block libraries in R2019b. Code will still work in all releases R2016a and higher.

1.4.0.1

Updated license

1.4.0.0

Updated for R2016a

1.3.0.0

Image seemed to be missing... have uploaded the image file...

1.2.0.0

Copyright line on the top