Detailed description |
|
OpenSim is intended to be linked with MATLAB according to this guide: https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+with+Matlab
However, the linking instructions are not multi-user friendly: In MATLAB's pathtool (Set Path), the path to the OpenSim Scripts Path of a local user profile is set with admin rights. Consequently, when another user logs into Windows and starts MATLAB, severe errors occur, leading to a temporary deactivation of the pathtool.
At our university, we use VMware DEM (a User Environment Management tool) to implement the following predefined settings whenever MATLAB or OpenSIM is launched:
1. The path to the OpenSim Java library, "C:\OpenSim 4.4\sdk\Java\org-opensim-modeling.jar," is added to the file "%AppData%\MathWorks\MATLAB\R2023a\javaclasspath.txt."
2. The path to the C++ libraries of OpenSim, on which the Java library depends, "C:\OpenSim 4.4\bin," is added to the file "%AppData%\MathWorks\MATLAB\R2023a\javalibrarypath.txt."
3. The following content is added to "...\Documents\MATLAB\startup.m":
up = getenv('userprofile');
sub = '\Documents\OpenSim\4.4\Code\Matlab\Utilities';
addpath([up sub])
clearvars up sub
This content adds the OpenSim Matlab Utilities from the script directory of the respective logged-in user to the Matlab PATH variable, but it does so non-permanently, specifically for the current Matlab session. This approach has the advantage that neither the system's "pathdef.m" needs to be modified with admin rights nor does a "pathdef.m" in the Documents folder of the roaming or local user profile need to be created.
All in all, it would be nice if the developers could provide a multi-user-friendly OpenSIM-MATLAB setup to avoid such tinkering. |
|