This file contains MATLAB code that reads in a text-based STL file and creates a SimMechanics block parameterized with the information from the STL file. The user selects the material for the body, and the script calculates the mass, inertia tensor, and location of the center of gravity. The resulting SimMechanics block uses the STL file for visualization.
STL files can be exported from most CAD tools and can also be exported from Google SketchUp once a plug-in has been installed (< http://www.3deefab.com/en/faq/stl >).
Please read the README.txt file to get started.
To find other SimMechanics examples, search for posts with the keyword "simmechanics"
< http://www.mathworks.com/matlabcentral/fileexchange/?term=%22simmechanics%22 >
To find other physical modeling examples, search for posts with the keyword "physical modeling"
< http://www.mathworks.com/matlabcentral/fileexchange/?term=%22physical+modeling%22 >
To learn more about MathWorks Physical Modeling Products, go to: < http://www.mathworks.com/physical-modeling/ >