Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Car = csvread('C:\Users\Роман\Downloads\Универ\6сем\SNAR\HW_3\data1.csv');
  2.  
  3. a = size(Car);
  4.  
  5. time1 = Car(2 : a(1), 1) - Car(2,1);
  6.  
  7. speed_x = [];
  8. speed_y = [];
  9. time2 = [];
  10.  
  11. for i = 2:a(1)
  12. time2(i) = Car(i, 1) - Car(2,1);
  13. speed_x(i) = abs(sin(Car(i, 8))) * Car(i, 14); #x
  14. speed_y(i) = abs(cos(Car(i, 8))) * Car(i, 14); #y
  15. endfor
  16.  
  17. subplot(2,1,1)
  18. hold on;
  19. grid on;
  20. xlabel('time, m', 'fontsize', 20);
  21. ylabel('OBD, km/h', 'fontsize', 20);
  22. title('OBD', 'fontsize', 24);
  23. plot(time2, speed_x, 'linewidth', 3);
  24. legend('speed');
  25.  
  26. subplot(2,1,2)
  27. hold on;
  28. grid on;
  29. xlabel('time, m', 'fontsize', 20);
  30. ylabel('GPS, km/h', 'fontsize', 20);
  31. title('GPS', 'fontsize', 24);
  32. plot(time2, speed_y, 'linewidth', 3);
  33. legend('speed');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement