Page 1 of 1

import .sto file in matlab

Posted: Tue Apr 03, 2018 11:56 am
by samberia
cant import states.sto from cmc result into matlab

Re: import .sto file in matlab

Posted: Tue Apr 03, 2018 12:34 pm
by jimmy
You can try and use some of the functions in this package;
https://simtk.org/projects/opensim-utils

There are other packages that could have the scripts your looking for here;
https://simtk-confluence.stanford.edu/d ... otion+Data

...and you can also try writing your own reader in Matlab ;)

Re: import .sto file in matlab

Posted: Tue Apr 03, 2018 10:00 pm
by tkuchida
If you just want the data, you can use something like

Code: Select all

states = dlmread('arm26_states.sto', '\t', 7,0);
or MATLAB's "Import Wizard" (type "uiimport" in the MATLAB Command Window). There are several other approaches depending on what you're trying to do with the data, including using OpenSim's Storage class (if you're using 3.3) or STOFileAdapter class (if you're using 4.0).

Re: import .sto file in matlab

Posted: Wed Apr 04, 2018 4:28 am
by baxterj
.mot and .sto files are pretty similar (with some small differences in the header info - the first 5 rows are the same and it ends with 'endheader' before the variable names and data). attached is a matlab function that reads both file formats and builds a structure.

*edit* i'm not able to attach the script to this post - feel free to PM