Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Evan Dooley
- Posts: 33
- Joined: Sun Nov 24, 2019 11:17 am
Post
by Evan Dooley » Mon Jul 06, 2020 8:05 am
Hello,
I am working on running a simulation using the Matlab API. I have created a model and it is initialized. I am then trying to use the ScaleTool command to scale the generic model to a subject specific model.
Code: Select all
scaler = ScaleTool('scaleMeasuermentSet_v11.xml'); %scale set up xml file
scaled = scaler.run();
model.initSystem();
modelPath = fullfile(cd, 'OttobockInMatlab_v05_scaled.osim');
model.print(modelPath);
This does not seem to save the scaled model, though the command line is showing that all of the scale factors have been computed.
How do you output the scaled model using Matlab?
Is there an example that shows how the scaling tool works through the API? Also are there any resources that show how you could set the scale tool parameters from Matlab, as opposed to loading a pre-made xml file (like commands to make the measurement set, set the mass, and direct to the static TRC file)?
Any tips or documentation would be greatly appreciated.
Thanks,
EAD
Tags:
-
Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Post
by Ayman Habib » Mon Jul 06, 2020 11:08 am
Hi Emily,
it's not clear from the code snippet you posted what is the relation between the model variable and the xml file contents. The scale tool performs both Scaling and Marker placement, if you specify <output_model_file> in the intended section/operation of the xml file then the tool will write the scaled model to a file, then you need to load the model from the file as usual to proceed. The scale tool doesn't provide easy way to interface programmatically with the scaled model directly.
Hope this helps,
-Ayman