Hello,
OpenSim indexes start from 0 whereas MATLAB's start from 1, however in the examples provided with OpenSim package (like createActuatorsFile.m), the index starts from 0. Kindly let me know how to achieve this. Because whenever I start indexing with 0 in my MATLAB code usign OpenSim libraries I get the following error.
"Array indices must be positive integers or logical values."
Regards,
Shivangi
MATLAB OpenSim indexing
- Shivangi Giri
- Posts: 51
- Joined: Sun Jul 02, 2017 3:04 am
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: MATLAB OpenSim indexing
Hi Shivangi,
This message doesn't come from OpenSim but from MATLAB which suggests you're trying to use MATLAB index on an OpenSim object. Fundamentally you should only use the OpenSim methods to access OpenSim objects, for example using methods like
Hope this helps,
-Ayman
This message doesn't come from OpenSim but from MATLAB which suggests you're trying to use MATLAB index on an OpenSim object. Fundamentally you should only use the OpenSim methods to access OpenSim objects, for example using methods like
rather than direct indexing.get(index)
Hope this helps,
-Ayman
- Shivangi Giri
- Posts: 51
- Joined: Sun Jul 02, 2017 3:04 am
Re: MATLAB OpenSim indexing
Thank you, Ayman for your reply.
Regards,
Shivangi
Regards,
Shivangi