Skip to main content

verifyMuscleTendonPersonalizationData.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function sees if the first 3 dimensions of inputs.jointMoment,
% inputs.muscleTendonLength, inputs.muscleTendonVelocity,
% inputs.muscleTendonMomentArm, and inputs.emgData have the same size.
%
%
% (struct) -> (None)
% Checks if first 3 dimensions of each data type matches


function verifyMuscleTendonPersonalizationData(inputs)
verifyFieldsExist(inputs)
try
sizeReference = size(inputs.muscleTendonLength);
verifyLength(sizeReference, 3)
% if(~all(sizeReference == size(inputs.muscleTendonLength)))
% error(); end
% momentArmSize = size(inputs.muscleTendonMomentArm);
% if(~all(sizeReference == momentArmSize(1:3)))
% error(); end
% if(~all(sizeReference == size(inputs.emgData))) error(); end
catch
throw(MException('','data value dimensions do not match'))
end
end

function verifyFieldsExist(inputs)
verifyField(inputs, 'jointMoment')
verifyField(inputs, 'muscleTendonLength')
verifyField(inputs, 'muscleTendonVelocity')
verifyField(inputs, 'muscleTendonMomentArm')
verifyField(inputs, 'emgData')
end