Hello !
I am trying to scale a model using the API on Matlab but my code doesn't work. I think I don't fully understand how the ScaleTool function is working. I didn't found any resources about how to scale a model with the API on the forum or in code examples.
I am triyng to scale the LFB-model.osim with a setup file Setup-scale_AF.xml.
Here is my code :
import org.opensim.modeling.*;
model = Model('.\LFB_model.osim');
model.initSystem();
ScTool = ScaleTool('.\Setup-scale_AF.xml');
ScTool.createModel(model); %don't work
ScTool.setModel(model); %don't work neither
ScTool.run();
Thank you in advance for any input or help you can provide !
Arthur Favennec
Scaling with Matlab API
- Arthur Favennec
- Posts: 4
- Joined: Thu Nov 28, 2019 6:13 am
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Scaling with Matlab API
Looking at the Doxygen page, it looks like the `setPathToSubject` function could be helpful here. Note that it takes a string as input, so make sure to use the file path rather than a Model object.
- Arthur Favennec
- Posts: 4
- Joined: Thu Nov 28, 2019 6:13 am
Re: Scaling with Matlab API
Thank you for your help !
Arthur
Arthur
- Jacob J. Banks
- Posts: 97
- Joined: Tue Jul 15, 2014 5:17 am
Re: Scaling with Matlab API
In case Carmichael's post didn't completely do the trick/your still having issues, here is a Matlab API we use/wrote to scale things. I think it is fairly self-explanatory. It requires you have a setup file already saved with some of your basic parameters.
Jake Banks
Jake Banks
- Attachments
-
- ScaleOpenSim.zip
- (1.36 KiB) Downloaded 94 times
- Arthur Favennec
- Posts: 4
- Joined: Thu Nov 28, 2019 6:13 am
Re: Scaling with Matlab API
Thank you for this example file. It helped me a lot !
Arthur Favennec
Arthur Favennec