Page 1 of 1

Calculating Muscle Lengths in MATLAB using OpenSim

Posted: Fri Jun 26, 2015 2:05 pm
by csauer88
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

Re: Calculating Muscle Lengths in MATLAB using OpenSim

Posted: Thu Jul 02, 2015 7:59 am
by jimmy
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

Re: Calculating Muscle Lengths in MATLAB using OpenSim

Posted: Mon Jul 06, 2015 12:42 pm
by csauer88
Thank you for the example code! It shows how to access the normalized fiber lengths, which was exactly what I was trying to find.