showMotionData.m 568 B

1234567891011121314151617181920
  1. function showMotionData(data, idx, x, y)
  2. X = 1:48;
  3. figure1 = figure;
  4. hold on
  5. plot (X, data(:,1,idx))
  6. plot (X, data(:,2,idx))
  7. plot (X, data(:,3,idx))
  8. title(sprintf("sampled from dataset, Gyroscope trace of x:%d, y:%d", x, y))
  9. legend({'GYRO_X', 'GYRO_Y', 'GYRO_Z'})
  10. hold off
  11. figure2 = figure;
  12. hold on
  13. plot (X, data(:,4,idx))
  14. plot (X, data(:,5,idx))
  15. plot (X, data(:,6,idx))
  16. title(sprintf("sampled from dataset, Accelerometer trace of x:%d, y:%d", x, y))
  17. legend({'ACC_X', 'ACC_Y', 'ACC_Z'})
  18. hold off
  19. end