Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function MEMS3(wolty As Double)
  2. Dim a, b, c, d, e, f, g, h, i, j As Double
  3. a = (wolty - 1) / ((2.3 - 1) / 100)
  4. b = (wolty - 2.3) / ((2.96 - 2.3) / 100) + 100
  5. c = (wolty - 2.96) / ((3.41 - 2.96) / 100) + 200
  6. d = (wolty - 3.41) / ((3.82 - 3.41) / 100) + 300
  7. e = (wolty - 3.82) / ((4.18 - 3.82) / 100) + 400
  8. f = (wolty - 4.18) / ((4.42 - 4.18) / 100) + 500
  9. g = (wolty - 4.42) / ((4.66 - 4.42) / 100) + 600
  10. h = (wolty - 4.66) / ((4.8 - 4.66) / 100) + 700
  11. i = (wolty - 4.8) / ((4.9 - 4.8) / 100) + 800
  12. j = (wolty - 4.9) / ((5 - 4.9) / 100) + 900
  13.  
  14. If wolty < 1 Or wolty > 2.3 Then
  15. a = 0
  16. End If
  17.  
  18. If wolty <= 2.3 Or wolty > 2.96 Then
  19. b = 0
  20. End If
  21.  
  22. If wolty <= 2.96 Or wolty > 3.41 Then
  23. c = 0
  24. End If
  25.  
  26. If wolty <= 3.41 Or wolty > 3.82 Then
  27. d = 0
  28. End If
  29.  
  30. If wolty <= 3.82 Or wolty > 4.18 Then
  31. e = 0
  32. End If
  33.  
  34. If wolty <= 4.18 Or wolty > 4.42 Then
  35. f = 0
  36. End If
  37.  
  38. If wolty <= 4.42 Or wolty > 4.66 Then
  39. g = 0
  40. End If
  41.  
  42. If wolty <= 4.66 Or wolty > 4.8 Then
  43. h = 0
  44. End If
  45.  
  46. If wolty <= 4.8 Or wolty > 4.9 Then
  47. i = 0
  48. End If
  49.  
  50. If wolty <= 4.9 Or wolty > 5 Then
  51. j = 0
  52. End If
  53. MEMS3 = a + b + c + d + e + f + g + h + i + j
  54. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement