Accessing model properties through Matlab API
Posted: Fri Sep 23, 2016 12:32 pm
Hi there - I am new to the OpenSim-Matlab interface! I'd like to do a few calculations in Matlab, using values from my scaled OpenSim model - scaled from gait2392.
Using "strengthScaler.m" (comes in the OpenSim download package) as a starting point, I have managed to read in muscle property values (OptimalFiberLength and MaxIsometricForce) from my scaled model. I would also like to use the API to read in properties of the model's bodies. Specifically, I would like the mass of each body so that I can sum them to create a whole_body_mass variable in Matlab. Since the masses of bodies is contained in the .osim file, ideally I'd like to use something as simple as "model_bodies = currentModel.getBodies" but I can't seem to find commands that will:
A) result in a list of bodies in the model; and then
B) report the mass of those bodies
Any help would be greatly appreciated! Thank you in advance - Nate
Using "strengthScaler.m" (comes in the OpenSim download package) as a starting point, I have managed to read in muscle property values (OptimalFiberLength and MaxIsometricForce) from my scaled model. I would also like to use the API to read in properties of the model's bodies. Specifically, I would like the mass of each body so that I can sum them to create a whole_body_mass variable in Matlab. Since the masses of bodies is contained in the .osim file, ideally I'd like to use something as simple as "model_bodies = currentModel.getBodies" but I can't seem to find commands that will:
A) result in a list of bodies in the model; and then
B) report the mass of those bodies
Any help would be greatly appreciated! Thank you in advance - Nate