Problem about opening a Opensim Model in MATLAB

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
John Gao
Posts: 3
Joined: Sat Feb 04, 2023 4:00 am

Problem about opening a Opensim Model in MATLAB

Post by John Gao » Fri Jun 09, 2023 12:31 pm

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

User avatar
Thomas Uchida
Posts: 1777
Joined: Wed May 16, 2012 11:40 am

Re: Problem about opening a Opensim Model in MATLAB

Post by Thomas Uchida » Mon Jun 12, 2023 4:17 pm

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").

POST REPLY