Share 
Follow 
AboutDownloadsDocumentsForumsSource CodeIssuesNews
Date:
2022-06-24 11:25
Priority:
3
State:
Open
Submitted by:
Lorenz Winkler (lenz)
Assigned to:
Nobody (None)
Summary:
Multiuser capability of Matlab Scripting Environment (Windows)

Detailed description
https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+with+Matlab#ScriptswithMatlab-MatlabSetupSettingUpYourMatlab-ScriptsEnvironment.

I think the above setup is not intended for a multi-user Windows system, certainly not for classrooms where normal users do not have write permissions.

In the instructions, a directory within a user profile (C:\User\<username>\Documents\OpenSim\4.3\Code\Matlab\Utilities) is added to the MATLAB search path of the machine-wide MATLAB installation (C:\Programs\MATLAB\R2022a\toolbox\local\pathdef.m).

Another user who logs into Windows and starts MATLAB gets severe errors with this because he does not have access to the Documents folder of the one user.

I suggest writing a manual setup or a configureOpenSim.m that adds the OpenSim Utilities' directory to MATLAB's PATH "USER" variable (pathdef.m in userprofile: C:\Users\<username>\Documents\MATLAB\pathdef.m).

Alternatively, you could write a startup.m in the current userprofile (C:\Users<username>\Documents\MATLAB\) that writes the path to the MATLAB PATH variable for the current MATLAB session only, without having to permanently edit pathdef.m:

See example of a startup.m

Users who do not have write permissions also cannot add to the PATH system environment variable (as shown in the instructions). However, they can edit the PATH user variable.





Add A Comment: Notepad

Message  ↓
Date: 2022-06-24 12:11
Sender: Lorenz Winkler

For example, at "Having trouble? Try manual setup..." you could offer the following step as an alternative to pathtool:

* In the MATLAB Command Window, type "edit(fullfile(userpath,'startup.m'))".
* Add following lines to the end of the file:

up = getenv('userprofile');
sub = '\Documents\OpenSim\4.3\Code\Matlab\Utilities';
addpath([up sub])
clearvars up sub

* On macOS, use forward slashes (/) instead of back slashes (\).
* Remove any entries for previous versions of OpenSim.
* Save changes to "startup.m".

Attachments:
Size Name Date By Download
119 bytesstartup.m2022-06-24 11:25lenzstartup.m
Field Old Value Date By
File Added797: startup.m2022-06-24 11:25lenz
Feedback