global uLink
global fname
global s
global f
s = 1300;
f = 1400;
fname = 'xsens.xlsx'
uLink(2).angle = resample_ZXY(2)
uLink(3).angle = resample_ZXY(3)
l = size(uLink(2).angle(:,2),1);
for i = 1:l
m(i) = sin(uLink(2).angle(i,2)-uLink(3).angle(i,3))*cos(uLink(2).angle(i,2)-uLink(3).angle(i,3))
end
cdata = [uLink(2).angle(:,2),uLink(3).angle(:,3),m]
imagesc(0:10:90,180:-20:0,cdata);
colormap hot;
colorbar;
axis xy;
daspect([1 1 1]);
function angle = resample_ZXY(fname,j)
global s
global f
ang = readtable(fname,"Sheet","Joint Angles ZXY");
ang = ang(s:f,:);
if j==0
angle = 0;
elseif j==2
ori_abd = ang.RightShoulderAbduction_Adduction;
ori_IE = ang.RightShoulderInternal_ExternalRotation;
ori_FE = ang.RightShoulderFlexion_Extension;
abd = interp1(ori_abd, 1:240/1000:length(ori_abd),"spline");
IE = interp1(ori_IE, 1:240/1000:length(ori_IE),"spline");
FE = interp1(ori_FE, 1:240/1000:length(ori_FE),"spline");
angle = [abd',IE',FE'];
elseif j==3
ori_EU = ang.RightElbowUlnarDeviation_RadialDeviation;
ori_PS = ang.RightElbowPronation_Supination;
ori_FE = ang.RightElbowFlexion_Extension;
EU = interp1(ori_EU, 1:240/1000:length(ori_EU),"spline");
PS = interp1(ori_PS, 1:240/1000:length(ori_PS),"spline");
FE = interp1(ori_FE, 1:240/1000:length(ori_FE),"spline");
angle = [EU',PS',FE'];
end