How to define joint angles in a .mat file

2 views (last 30 days)
NAVJOT SINGH
NAVJOT SINGH on 16 Jul 2020
Answered: Steve Miller on 25 Oct 2021
I want to define joint angles in the mat file and then I want to use it in simscape multibody. I am working on a human body and I want to perform sit to stand motion. I have to define joint angles for knee,ankle and hip, for which I will need to define joint angles for each of these in separate mat files and then use them as inputs for the revolute joints. But how to do this.Any help will be appreciated. Thanks

Answers (1)

Steve Miller
Steve Miller on 25 Oct 2021
You can save any numerical data to a .mat file using the save command.
You load that file using the load command.
Once the variables are in the MATLAB workspace, you can use a From Workspace block to refer to those values as a Simulink signal. Connect that signal to a Simulink-PS Converter block to convert it to a Physical Signal.
The joint needs to be configured for motion actuation.
  1. Double-click on the Joint
  2. Expand the Actuation section
  3. Set "Motion" to "Provide by Input"
  4. Set "Torque to "Automatically Computed"
Then connect the physical signal to the input on the Joint block.
--Steve

Community Treasure Hunt

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

Start Hunting!