Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. Export["test.dat", {#, Sin[#]} & /@ Range[0, 6.1, .01]];
  2.  
  3. importFunction[fn_?FileExistsQ] := Module[{list},
  4. list = Import[fn, "Table"];
  5. Interpolation[list]
  6. ];
  7.  
  8. importFunction2[fn_?FileExistsQ] := Module[{list},
  9. list = Import[fn, "Table"];
  10. list[[#]] &
  11. ];
  12.  
  13. DeleteFile["test.dat"];
  14. testfun[.17]
  15. testfun2[18]
  16. Sin[.17]
  17. (* 0.169182 *)
  18. (* {0.17, 0.169182} *)
  19. (* 0.169182 *)
  20.  
  21. ?testfun2
  22.  
  23. testfun2=list$5210[[#1]]&
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement