%% 静止加速度分析
JZ_Data = load("静止10s中.mat"); %载入静止的手机传感器数据
tDate = datenum(JZ_Data.Acceleration.Timestamp);
yData_accx = JZ_Data.Acceleration.X;
yData_accy = JZ_Data.Acceleration.Y;
yData_accz = JZ_Data.Acceleration.Z;
grid on;
%X轴加速度曲线
subplot(2,2,1);
plot(tDate,yData_accx,'r-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("X轴加速度");
title('X轴加速度曲线');
%Y轴加速度曲线
subplot(2,2,2);
plot(tDate,yData_accy,'g-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Y轴加速度");
title('Y轴加速度曲线');
%Z轴加速度曲线
subplot(2,2,3);
plot(tDate,yData_accz,'b-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Z轴加速度");
title('Z轴加速度曲线');
%总的加速度曲线
subplot(2,2,4);
plot(tDate,yData_accx,'r-',tDate,yData_accy,'g-',tDate,yData_accz,'b-');
legend('ACC_X','ACC_Y','ACC_Z');
title('手机静止10s,XYZ轴加速度传感器数据曲线');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
%% 静止角加速度分析
JZ_Data = load("静止10s中.mat"); %载入静止的手机传感器数据
tDate = datenum(JZ_Data.AngularVelocity.Timestamp);
yData_angx = JZ_Data.AngularVelocity.X;
yData_angy = JZ_Data.AngularVelocity.Y;
yData_angz = JZ_Data.AngularVelocity.Z;
grid on;
%X轴角加速度曲线
subplot(2,2,1);
plot(tDate,yData_angx,'r-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("X轴角加速度");
title('X轴角加速度曲线');
%Y轴加速度曲线
subplot(2,2,2);
plot(tDate,yData_angy,'g-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Y轴角加速度");
title('Y轴角加速度曲线');
%Z轴加速度曲线
subplot(2,2,3);
plot(tDate,yData_angz,'b-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Z轴角加速度");
title('Z轴角加速度曲线');
%总的加速度曲线
subplot(2,2,4);
plot(tDate,yData_angx,'r-',tDate,yData_angy,'g-',tDate,yData_angz,'b-');
legend('ANG_X','ANG_Y','ANG_Z');
title('手机静止10s,XYZ轴角加速度传感器数据曲线');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
%% 静止磁场分析
JZ_Data = load("静止10s中.mat"); %载入静止的手机传感器数据
tDate = datenum(JZ_Data.MagneticField.Timestamp);
yData_magx = JZ_Data.MagneticField.X;
yData_magy = JZ_Data.MagneticField.Y;
yData_magz = JZ_Data.MagneticField.Z;
grid on;
%X轴磁场曲线
subplot(2,2,1);
plot(tDate,yData_magx,'r-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("X轴磁场");
title('X轴磁场曲线');
%Y轴磁场曲线
subplot(2,2,2);
plot(tDate,yData_magy,'g-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Y轴磁场");
title('Y轴磁场曲线');
%Z轴加速度曲线
subplot(2,2,3);
plot(tDate,yData_magz,'b-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("Z轴磁场");
title('Z轴磁场曲线');
%总的加速度曲线
subplot(2,2,4);
plot(tDate,yData_magx,'r-',tDate,yData_magy,'g-',tDate,yData_magz,'b-');
legend('Mag_X','Mag_Y','Mag_Z');
title('手机静止10s,XYZ轴磁场传感器数据曲线');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
%% 静止方向分析
JZ_Data = load("静止10s中.mat"); %载入静止的手机传感器数据
tDate = datenum(JZ_Data.Orientation.Timestamp);
yData_yall = JZ_Data.Orientation.X;
yData_pit = JZ_Data.Orientation.Y;
yData_roll = JZ_Data.Orientation.Z;
grid on;
%方向曲线
subplot(2,2,1);
plot(tDate,yData_yall,'r-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("方向角");
title('方向角曲线');
%俯仰曲线
subplot(2,2,2);
plot(tDate,yData_pit,'g-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("俯仰角");
title('俯仰角曲线');
%翻滚曲线
subplot(2,2,3);
plot(tDate,yData_roll,'b-');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);
legend("翻滚角");
title('翻滚角曲线');
%总的加速度曲线
subplot(2,2,4);
plot(tDate,yData_yall,'r-',tDate,yData_pit,'g-',tDate,yData_roll,'b-');
legend('偏航角','俯仰角','翻滚角');
title('手机静止10s,偏航角俯仰角翻滚角的数据曲线');
xlabel('时间(hour:min:sec)');
ylabel('幅值');
dateaxis('x',13);