Changing CoordinateLimitForce properties in Matlab script

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Dustin Crouch
Posts: 5
Joined: Tue Jan 05, 2010 11:56 am

Changing CoordinateLimitForce properties in Matlab script

Post by Dustin Crouch » Wed May 06, 2015 10:04 am

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!

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

Re: Changing CoordinateLimitForce properties in Matlab scrip

Post by jimmy d » Wed May 27, 2015 10:50 am

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

POST REPLY