Page 1 of 1

Problem about opening a Opensim Model in MATLAB

Posted: Fri Jun 09, 2023 12:31 pm
by xiaoqianggao
Hi,

I am trying to open the Toylanding_AFO model in the MATLAB.

Here are my code

import org.opensim.modeling.*
model = Model('D:\INDIVIDUAL PROJECT\opensim\OpenSim 4.4\Resources\Models\NEWdLanding\ToyLandingModel_AFO.osim');
state = osimModel.initSystem();

Now I received the error as below,
Java exception occurred:
java.io.IOException: Object: Cannot open file D:\INDIVIDUAL PROJECT\opensim\OpenSim
4.4\Resources\Models\NEWdLanding\ToyLandingModel_AFO.osim. It may not exist or you do not have permission to read
it.
Thrown at Object.cpp:105 in Object().

at org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_1(Native Method)

at org.opensim.modeling.Model.<init>(Model.java:821)

I can't find the reason of the error. Just check the path and there is no mistake. Any help would be appreciated.

Thanks,
John

Re: Problem about opening a Opensim Model in MATLAB

Posted: Mon Jun 12, 2023 4:17 pm
by tkuchida
Does Matlab have permission to access the D: drive ("you do not have permission to read it")? Perhaps try moving the .osim file into a new folder on your desktop or in a directory that you know Matlab can access (e.g., "C:\Users\John\Documents\MATLAB").