prescribe motion in model

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ashley Heers
Posts: 11
Joined: Thu Apr 10, 2014 6:20 am

prescribe motion in model

Post by Ashley Heers » Sat Nov 22, 2014 9:10 am

Hello, all,

I am using matlab to add prescribed motion to my model (prescribeMotionInModel.m). I got the function to work once, but now I am trying to prescribe motion for a different set of kinematics (different mot file) and matlab is giving results for my original mot file. When I look at the out log, I see "old version storage/motion file encountered", but I cannot figure out how to delete that older file. I've tried clearing the workspace, restarting and rehashing, but no luck. Has anyone encountered this problem and fixed it? I don't use matlab very often, so it may be something pretty obvious...

Thanks!

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

Re: prescribe motion in model

Post by jimmy d » Wed Jun 28, 2017 4:11 pm

You are pointing the script to the wrong mot file. The script itself takes the path to the motion file or, if no inputs are given, it asks you to select the file.

Code: Select all

function prescribeMotionInModel(Model_In, Mot_In, Model_Out)
...
elseif nargin < 2
    [Mot_In, motpath] = uigetfile('.mot', 'Please select a motion file');
    fileoutpath = [Model_In(1:end-5),'_Prescribed.osim'];  
    motfilepath = [motpath Mot_In];       
    modelfilepath = Model_In;    
...
else
    modelfilepath = Model_In;
    motfilepath = Mot_In;
    fileoutpath = Model_Out;    
...

% Create the coordinate storage object from the input .sto file
coordinateSto=Storage(motfilepath);

So if the analysis is using the 'wrong' mot file, it is because you are giving it the wrong one.

POST REPLY