Problem with Matlab API
Posted: Sun Apr 23, 2023 4:55 pm
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
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