Guest User

Untitled

a guest
Aug 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. lsfit:{(enlist y) lsq x xexp/: til 1+z};
  2. interp:{[xn;x;y]sum (1;xn)*flip lsfit[x;y;1]};
  3.  
  4. table:([] amount:500 730 1250;xRng:(0 1;0 1;1 2);yRng:(5 7f; 5 7f; 7 10f));table
  5.  
  6. amount xRng yRng
  7. 500 0 1 5 7f
  8. 730 0 1 5 7f
  9. 1250 1 2 7 10f
  10.  
  11. amount xRng yRng result
  12. 500 0 1 5 7f 6
  13. 730 0 1 5 7f 6.46
  14. 1250 1 2 7 10f 7.75
  15.  
  16. interp[first table[`amount]%1000;first table[`xRng];first table[`yRng]]
Add Comment
Please, Sign In to add comment