Page 1 of 1

Matlab and OpenSim 3.3 and 4.0

Posted: Wed Jul 24, 2019 9:54 pm
by arashopensim
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 43 times

Thank you,
Arash

Re: Matlab and OpenSim 3.3 and 4.0

Posted: Sun Jul 28, 2019 11:03 am
by jimmy
The .run() method on ScaleTool was only introduced in OpenSim 4.0, so it doesn't exist in 3.3.

Re: Matlab and OpenSim 3.3 and 4.0

Posted: Tue Jul 30, 2019 9:06 pm
by arashopensim
Thanks a lot James. It was really helpful.

Best,
Arash