SHARE
TWEET

Untitled

a guest Feb 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data1 = load('data/data_0.2/part2_position.txt');
  2. data2 = load('data/data_0.3/part2_position.txt');
  3. data3 = load('data/data_0.4/part2_position.txt');
  4. data4 = load('data/data_0.5/part2_position.txt');
  5. data5 = load('data/data_0.6/part2_position.txt');
  6.  
  7. t1 = data1(:,1);
  8. x1 = data1(:,2);
  9. t2 = data2(:,1);
  10. x2 = data2(:,2);
  11. t3 = data3(:,1);
  12. x3 = data3(:,2);
  13. t4 = data4(:,1);
  14. x4 = data4(:,2);
  15. t5 = data5(:,1);
  16. x5 = data5(:,2);
  17.  
  18. numPeaks = [2,2,2,3,4];
  19. p1 = findPeaks(data1,numPeaks(1));
  20. p2 = findPeaks(data2,numPeaks(2));
  21. p3 = findPeaks(data3,numPeaks(3));
  22. p4 = findPeaks(data4,numPeaks(4));
  23. p5 = findPeaks(data5,numPeaks(5));
  24.  
  25. myFit1 = fit(p1(:,1),p1(:,2),'exp1');
  26. myFit2 = fit(p2(:,1),p2(:,2),'exp1');
  27. myFit3 = fit(p3(:,1),p3(:,2),'exp1');
  28. myFit4 = fit(p4(:,1),p4(:,2),'exp1');
  29. myFit5 = fit(p5(:,1),p5(:,2),'exp1');
  30.  
  31. a1 = 23.84;
  32. b1 = -0.8044;
  33. a2 = 7.332;
  34. b2 = -0.4692;
  35. a3 = 12.41;
  36. b3 = -0.3557;
  37. a4 = 11.08;
  38. b4 = -0.2756;
  39. a5 = 12.87;
  40. b5 = -0.2195;
  41.  
  42. f1 = a1 * exp(b1 * t1);
  43. f2 = a2 * exp(b2 * t2);
  44. f3 = a3 * exp(b3 * t3);
  45. f4 = a4 * exp(b4 * t4);
  46. f5 = a5 * exp(b5 * t5);
  47.  
  48. figure();
  49. hold on;
  50. plot(t1,x1);
  51. plot(t1,f1);
  52. hold off;
  53.  
  54. figure();
  55. hold on;
  56. plot(t2,x2);
  57. plot(t2,f2);
  58. hold off;
  59.  
  60. figure();
  61. hold on;
  62. plot(t3,x3);
  63. plot(t3,f3);
  64. hold off;
  65.  
  66. figure();
  67. hold on;
  68. plot(t4,x4);
  69. plot(t4,f4);
  70. hold off;
  71.  
  72. figure();
  73. hold on;
  74. plot(t5,x5);
  75. plot(t5,f5);
  76. hold off;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top