function F_resultant = postprocessing_contact_force(Dir_contact,F_contact) %{ Function for defining the resultant contact force. -------------------------------------------------------------------------- Syntax : F_resultant = postprocessing_contact_force(Dir_contact,F_contact) -------------------------------------------------------------------------- Function Description : This function defines the resultant contact force associated with forces applying on each of the points on the humeral head. The inputs for this function are a structure and a matrix containing the direction and the magnitude of the forces at each of the points on the humeral head for every time step, respectively. -------------------------------------------------------------------------- %} F_resultant = zeros(3,1); % define the resultant force at/around HH due to the contact for i = 1:size(F_contact,1)-1 for j = 2:size(F_contact,2)-1 F_resultant = F_contact(i,j)*Dir_contact{i,j} + F_resultant; end end % the contact force associated with the top point F_resultant = F_contact(1,1)*Dir_contact{1,1} + F_resultant; % the contact force associated with the bottom point F_resultant = F_contact(size(F_contact,1),size(F_contact,2))*Dir_contact{size(F_contact,1),size(F_contact,2)} + F_resultant; return;