Skip to main content

modifyModelForces.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function disables all muscles, if any, in the osim model. Point and
% torque actuators are also added to the model if contact surfaces exist.
% The modified model is then saved and printed.
%
% (struct) -> (struct)
% Modifies osim model


function inputs = modifyModelForces(inputs)
if ~isa(inputs.model, 'org.opensim.modeling.Model')
model = Model(inputs.model);
end
[model, inputs] = disableModelMuscles(inputs, model);
model = addContactSurfaceActuators(inputs, model);
inputs.mexModel = strcat(strrep(inputs.model,'.osim',''), '_inactiveMuscles.osim');
model.print(inputs.mexModel);
end