Exporting a opensim model to MATLAB

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Yokhesh KrishnasamyTamilselvam
Posts: 9
Joined: Fri Jan 25, 2019 9:53 am

Exporting a opensim model to MATLAB

Post by Yokhesh KrishnasamyTamilselvam » Thu Feb 07, 2019 1:22 pm

Hi,

I have created a simulation model in Opensim 4.0 through Notepad++
But, i would like create a MATLAB/python program for the same simulation. I was able to install the opensim package in both MATLAB and python.
Could anyone let me know if there is a way to export the .osim file into matlab to create .m matlab file or do i have write a separate matlab code for the same simulation to do it?
One more thing, the reason i wanted to create a MATLAB code for the simulation is that I have been using a constant value to specify the 'location in parent' value for the body but instead i would like to use a variable to specify it.
For instance:
I am currently using the following
<location_in_parent>0 0.8 0</location_in_parent>
But i would like to use a variable like the following
<location_in_parent>0 t 0</location_in_parent>
where i can change the value the variable 't' whenever i want.
If this can be done, Please let me know about that as well.

Thank you.

Tags:

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

Re: Exporting a opensim model to MATLAB

Post by jimmy d » Fri Feb 08, 2019 11:26 am

You will need to write your own script that reads your model into memory, makes edits, and runs a simulation. There are example scripts in your OpenSim Resources/Code/Matlab directory. An example of editing a models muscle strength can be seen here

POST REPLY