MATLAB Scripting with OpenSim 4.4

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Nathan Knodel
Posts: 15
Joined: Mon Jun 10, 2019 10:08 am

MATLAB Scripting with OpenSim 4.4

Post by Nathan Knodel » Tue Mar 11, 2025 7:16 am

Hello,

I have been working on a project in MATLAB using the OpenSim API. Yesterday, I started getting an error whenever I try to run an OpenSim system command (e.g., !opensim-cmd run-tool [setup_name.xml]). I've tried numerous troubleshooting steps and can't seem to find a resolution to the issue. Specifically, this is the output I get in MATLAB when I run any !opensim-cmd:

/bin/bash: opensim-cmd: command not found

I have reconfigured MATLAB for OpenSim several times and can use all other functions in the API successfully. I've also verified that the OpenSim bin folder is on my system path (when using echo $PATH, the last item is /Applications/OpenSim 4.4/bin) and I've tried uninstalling and reinstalling MATLAB.

For further context, I'm using the intel-based MATLAB version and running it through Rosetta (again, I've successfully been doing this for almost a week at this point, but just started running into this issue).

The only other relevant pieces of information that I can think of are the following:
1. At some point in the scripting, the following line was run: setenv('PATH',[getenv('PATH'),':/usr/local/bin']). When I run getenv('PATH') in MATLAB, it produces: '/usr/bin:/bin:/usr/sbin:/sbin'. (not sure if this is expected/desired)
2. Not long before this started happening, I was having frequent MATLAB crashes when running a testing script that built an AnalyzeTool setup xml file from scratch (by appending a JointReaction and Kinematics setup to it).

Any guidance on this would be greatly appreciated.

Thank you,
Nathan

Tags:

POST REPLY