Calculating Muscle Lengths in MATLAB using OpenSim

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Colton Sauer
Posts: 10
Joined: Tue May 05, 2015 12:18 pm

Calculating Muscle Lengths in MATLAB using OpenSim

Post by Colton Sauer » Fri Jun 26, 2015 2:05 pm

Hi All,

I have experience with both OpenSim and MATLAB, but I am having a difficult time understanding how they fit together. I have already found how to load my model, but I am not sure how to apply a .mot to it and then extract the muscle length data (as a function of the motion) to store into a MATLAB structure. Is there a library somewhere that shows all of the usable OpenSim functions in MATLAB? I am not sure where all of the functions in the MATLAB examples are coming from. I found a method for finding this information exclusively through the OpenSim GUI, but I am hoping to write MATLAB code to automate the process. Any help is appreciated.

Colton

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Calculating Muscle Lengths in MATLAB using OpenSim

Post by jimmy d » Thu Jul 02, 2015 7:59 am

There are just to many functions to hand make a library for. We tried to automate it but we couldn't find worthwhile methods. The OpenSim Doxygen site (https://simtk.org/api_docs/opensim/api_docs/) has all the documentation for functions. Granted, it is hard for Matlab users (non C++) to understand at first. It took me a long time to get a hang of it and not all the functions are made available in Matlab.

I have some example code that does something similar to what you want to do; https://github.com/jimmyDunne/stackJimm ... LfromMot.m

Cheers,
-james

User avatar
Colton Sauer
Posts: 10
Joined: Tue May 05, 2015 12:18 pm

Re: Calculating Muscle Lengths in MATLAB using OpenSim

Post by Colton Sauer » Mon Jul 06, 2015 12:42 pm

Thank you for the example code! It shows how to access the normalized fiber lengths, which was exactly what I was trying to find.

POST REPLY