Page 1 of 1

Exporting a opensim model to MATLAB

Posted: Thu Feb 07, 2019 1:22 pm
by yokhesh
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.

Re: Exporting a opensim model to MATLAB

Posted: Fri Feb 08, 2019 11:26 am
by jimmy
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