Page 1 of 1

Changing CoordinateLimitForce properties in Matlab script

Posted: Wed May 06, 2015 10:04 am
by dustpack
Hello,

I'm trying to change the stiffness values of a CoordinateLimitForce element via Matlab script. So far I am able to get the CoordinateLimitForce element as a 'Force' object, then get write access to the properties 'lower_limit' and 'upper_limit' as an AbstractProperty. Here's the script I have so far:

osimModel.getForceSet.get('element_name').updPropertyByName('upper_limit')

I'm trying to change the stiffness values, but I can't figure out from the documentation how to actually do so. Maybe there's a more straightforward way than how I'm attempting it. Does anyone else know how? The property is of type 'double'.

I'd really appreciate someone's help with this. Thank you!

Re: Changing CoordinateLimitForce properties in Matlab scrip

Posted: Wed May 27, 2015 10:50 am
by jimmy
Hi Dustin-

You may have to use a safedowncast method to access the CoordinateLimitForce methods.

This link has an example of using safedowncast on a joint type.

Let us know if that helps

-James