Page 1 of 1

prescribe motion in model

Posted: Sat Nov 22, 2014 9:10 am
by ashmheers
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!

Re: prescribe motion in model

Posted: Wed Jun 28, 2017 4:11 pm
by jimmy
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.