i'm trying to connect opensim and Matlab, during scripting of Matlab i receive an error in this field '' Using a model's "Lists" through iterators''
for example, i write this code:
>> model = Model("Tug_of_War.osim")
bodyList = model.getBodyList(); % Get the Model's BodyList
iter = bodyList.begin(); % Start the iterator at the beginning of the list
while ~iter.equals(bodyList.end()) % Stay in the loop until the iterator reaches the end of the list
iter.getName() % Print name to console
iter.next() % Move the iterator to the next body in the list
end
and receive this error for any model i use
Java exception occurred:
java.io.IOException: Object: Cannot open file Tug_of_War.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)
is there any solution?
i use 64 operating system and 64 Matlab
Problem with Matlab API
- nadia Khlail
- Posts: 1
- Joined: Thu Nov 17, 2022 1:54 pm
- Mohammadreza Rezaie
- Posts: 408
- Joined: Fri Nov 24, 2017 12:48 am
Re: Problem with Matlab API
Hi,
Please double-check your model file exists in your MATLAB working directory. You can also write the full path of the model.Cannot open file Tug_of_War.osim. It may not exist or you do not have permission to read it.