I haven't seen anyone else report this error, but for me, neither MATLAB R2018b with OpenSim 4.0 nor MATLAB R2018b with OpenSim 3.3 works on Windows 10. I've been using OpenSim 3.3 with MATLAB R2017b for a while, which has worked fine, but recently my institution has received a license for MATLAB R2018b, just as the license for MATLAB R2017b has run out. So now I only have access to MATLAB R2018b, but it doesn't seem to work with OpenSim at all: with OpenSim 3.3, if I try to run configureOpenSim.m [someDirectory\OpenSim 3.3\Scripts\Matlab\configureOpenSim.m], I get an error with fprintf ('Error with fprintf \ Invalid file identifier. Use fopen to generate a valid file identifier.', also see the attached OpenSim3.3_MATLAB2018_configureOpenSim.png) If I debug, I can see this is because the file ID for opening 'C:\Program Files\MATLAB\R2018b\toolbox\local\classpath.txt' is -1, from the line 'fileID = fopen(txtname,'w');'. If I attempt 'fileID = fopen(txtname,'r');', to open the same file with read permissions, the fileID becomes 3, which means the file was successfully opened. The fopen merely doesn't work for writing. I get the same result (fileID = -1) whether I open as a non-admin user logged into a non-admin account, or as an admin logged into a non-admin account, or as an admin logged into an admin account.
As for using MATLAB R2018b with OpenSim 4.0, I found the configureOpenSim.m in OpenSim 4.0 (the main one, at the top of the OpenSim Downloads page on SimTK <https://simtk.org/frs/?group_id=91>). I opened MATLAB R2018b as admin in a non-admin account and ran that configureOpenSim.m, and I'm pretty sure that it reported that 'Paths have been successfully updated for the OpenSim API ' [something I don't remember] 'installed at ' [something I don't remember], or something along the lines of 'Path successfully updated'. I know that it reported that 'To complete setup, restart MATLAB. To test your set up, type: `model = org.opensim.modeling.Model();'. So I restarted MATLAB, but upon starting MATLAB MATLAB threw the following error (also see the attached OpenSim4.0_MATLAB2018_configureOpenSim.png):
Code: Select all
An error occurred while trying to determine whether "pathdef" is a function
name.
Undefined function 'usejava' for input arguments of type 'char'.
Warning: MATLAB did not appear to successfully set the search path. To recover
for this session of MATLAB, type "restoredefaultpath;matlabrc". To find out how
to avoid this warning the next time you start MATLAB, type "docsearch problem
path" after recovering for this session.
Primary and Secondary School License -- for use in teaching and
meeting course requirements at primary and secondary schools only.
Warning: Initializing Java preferences failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should
be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function 'usejava' for input arguments of type 'char'.
> In matlabrc (line 66)
Warning: Initializing MATLAB Graphics failed.
This indicates a potentially serious problem in your MATLAB setup, which should
be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Undefined function or variable 'ismac'.
> In hgrc (line 163)
In matlabrc (line 72)
Warning: Failed to add default profiler filters.
> In matlabrc (line 81)
Undefined function or variable 'rmiml.getAll'.
Undefined function or variable 'rmiml.visibleInToolstrip'.
Undefined function or variable
'internal.matlab.desktop.editor.getSystemObjectInfo'.
Undefined function or variable
'matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip'.
Undefined function or variable 'rmiml.getAll'.
Undefined function or variable
'matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip'.
Undefined function or variable
'internal.matlab.desktop.editor.getSystemObjectInfo'.
Undefined function or variable 'rmiml.visibleInToolstrip'.
Undefined function or variable 'rmiml.getAll'.
Undefined function or variable
'matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip'.
Undefined function or variable
'internal.matlab.desktop.editor.getSystemObjectInfo'.
Undefined function or variable 'rmiml.visibleInToolstrip'.
Undefined function or variable 'rmiml.visibleInToolstrip'.
Undefined function or variable 'connector.ensureServiceOn'.
Undefined function or variable 'connector.ensureServiceOn'.
Undefined function or variable 'connector.ensureServiceOn'.
Undefined function or variable 'connector.ensureServiceOn'.
com.mathworks.installservicehandler.exception.InstallServiceHandlerInternalException: An internal exception occurred inside the install service handler mechanism
at com.mathworks.matlab_login.MatlabLogin.initializeLoginServices(Unknown Source)
at com.mathworks.toolbox.distcomp.mwlogin.MatlabLoginController.<clinit>(MatlabLoginController.java:43)
at com.mathworks.toolbox.distcomp.ui.desk.ClusterProfilesMenu$2.run(ClusterProfilesMenu.java:160)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.mathworks.mvm.exec.MvmExecutionException: connector.ensureServiceOn
at com.mathworks.mvm.exec.NativeFutureResult.nativeGet(Native Method)
at com.mathworks.mvm.exec.NativeFutureResult.get(NativeFutureResult.java:62)
at com.mathworks.mvm.exec.FutureResult.getInternal(FutureResult.java:404)
at com.mathworks.mvm.exec.FutureFevalResult.getInternal(FutureFevalResult.java:49)
at com.mathworks.mvm.exec.FutureResult.get(FutureResult.java:262)
at com.mathworks.matlabserver.connector.impl.ConnectorImpl.doEnsureServiceOn(ConnectorImpl.java:211)
at com.mathworks.matlabserver.connector.api.Connector.ensureServiceOn(Connector.java:133)
... 8 more
Undefined function or variable 'matlab.supportpackagemanagement.internal.getInstalledSupportPackagesInfo'.
Undefined function or variable 'mls.internal.FevalService.init'.
java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.services.editordataservice.EditorDataServiceManager$SingletonHolder
at com.mathworks.services.editordataservice.EditorDataServiceManager.getInstance(EditorDataServiceManager.java:118)
at com.mathworks.connector.standalone_host.impl.StandaloneHostImpl.startEditor(StandaloneHostImpl.java:244)
at com.mathworks.connector.standalone_host.impl.StandaloneHostImpl.doStart(StandaloneHostImpl.java:101)
at com.mathworks.connector.standalone_host.StandaloneHost.start(StandaloneHost.java:60)
Undefined function or variable 'connector.internal.lifecycle.callConnectorStarted'.
Thank you!
Stephanie