daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = {{0.1},{0.2}};
  2. Do[datax[i] = {}; dataxm[i] = {};, {i, 1, 2}]
  3.  
  4. Do[
  5.  x = x + t;
  6.  Do[AppendTo[datax[i], Flatten[{t, x[[i]]}]];, {i, 1, 2}], {t, 0, 1, 0.1}]
  7.  
  8.  
  9.  datax[1]
  10.  
  11.  {{0., 0.1}, {0.1, 0.2}, {0.2, 0.4}, {0.3, 0.7}, {0.4, 1.1}, {0.5, 1.6}, {0.6, 2.2}, {0.7, 2.9}, {0.8, 3.7}, {0.9, 4.6}, {1., 5.6}}
  12.  
  13. datax[2]
  14.  
  15. {{0., 0.2}, {0.1, 0.3}, {0.2, 0.5}, {0.3, 0.8}, {0.4, 1.2}, {0.5,
  16.   1.7}, {0.6, 2.3}, {0.7, 3.}, {0.8, 3.8}, {0.9, 4.7}, {1., 5.7}}
  17.    
  18. xm = {{0.1},{0.2}};
  19. Do[
  20.      xm = xm + t;
  21.      Do[dataxm[i] = Reap[Sow[{t, x[[i]]}]][[2, 1]], {i, 1, 2}]
  22.          , {t, 0, 1, 0.1}]
  23.  
  24. dataxm[1]
  25. {{1., {5.6}}}
  26.  
  27.  dataxm[2]
  28. {{1., {5.7}}}
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