Matlab and OpenSim 3.3 and 4.0

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Arash Mohammadzadeh Gonabadi
Posts: 34
Joined: Sun Sep 10, 2017 10:44 am

Matlab and OpenSim 3.3 and 4.0

Post by Arash Mohammadzadeh Gonabadi » Wed Jul 24, 2019 9:54 pm

Hello all,

I have a question about OpenSim 3.3 and Matlab 2017b.

=> When I run the following code in Matlab 2018b with OpenSim 4.0, it works well.


clc
clear
import org.opensim.modeling.*
model = Model('gait2392_simbody.osim');
model.initSystem();
scaleTool = ScaleTool(['subject01_Setup_Scale.xml']);
scaleTool.run();






=> But when I run it in Matlab 2017b with OpenSim 3.3 it shows the following error in Matlab:




Warning: Inputs must be character vectors, cell arrays of character vectors, or string arrays.
> In run (line 37)
In Untitled (line 7)
Error using strrep
Conversion to double from org.opensim.modeling.ScaleTool is not possible.

Error in run (line 37)
scriptname = strrep(scriptname,'/','\');

Error in Untitled (line 7)
scaleTool.run();





By any chance does anyone know the reason?
I have attached the files and code.
OpenSim Matlab.rar
(173.71 KiB) Downloaded 31 times

Thank you,
Arash

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Matlab and OpenSim 3.3 and 4.0

Post by jimmy d » Sun Jul 28, 2019 11:03 am

The .run() method on ScaleTool was only introduced in OpenSim 4.0, so it doesn't exist in 3.3.

User avatar
Arash Mohammadzadeh Gonabadi
Posts: 34
Joined: Sun Sep 10, 2017 10:44 am

Re: Matlab and OpenSim 3.3 and 4.0

Post by Arash Mohammadzadeh Gonabadi » Tue Jul 30, 2019 9:06 pm

Thanks a lot James. It was really helpful.

Best,
Arash

POST REPLY