import .sto file in matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
raman samberia
Posts: 28
Joined: Tue Jan 03, 2017 11:29 pm

import .sto file in matlab

Post by raman samberia » Tue Apr 03, 2018 11:56 am

cant import states.sto from cmc result into matlab

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

Re: import .sto file in matlab

Post by jimmy d » Tue Apr 03, 2018 12:34 pm

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 ;)

User avatar
Thomas Uchida
Posts: 1790
Joined: Wed May 16, 2012 11:40 am

Re: import .sto file in matlab

Post by Thomas Uchida » Tue Apr 03, 2018 10:00 pm

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).

User avatar
Josh Baxter
Posts: 29
Joined: Fri Mar 11, 2016 12:29 pm

Re: import .sto file in matlab

Post by Josh Baxter » Wed Apr 04, 2018 4:28 am

.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

POST REPLY