Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. a = input('Enter an input value for a:');
  2. b = input('Enter an input value for b:');
  3. c = input('Enter an input value for c:');
  4. d = input('Enter an input value for d:');
  5. MINIMUM_TEMPERATURE = input('Enter minimum temperature :');
  6. MAXIMUM_TEMPERATURE = input('Enter maximum temperature :');
  7. temp_m = MINIMUM_TEMPERATURE;
  8. temp_max = MAXIMUM_TEMPERATURE;
  9. count = 0;
  10. while(temp_m <= MAXIMUM_TEMPERATURE)
  11. count = count + 1;
  12. temp_m = temp_m + 2;
  13. if(temp_m > MAXIMUM_TEMPERATURE)
  14. count = count + 1;
  15. end
  16. end
  17.  
  18. res = zeros(count,2);
  19. T = MINIMUM_TEMPERATURE;
  20.  
  21. for j = 1:count
  22. cap = a + (b * T) + (c * power(T,2)) + (d * power(T,3));
  23. res(j,1)= T;
  24. res(j,2)= cap;
  25. T = T + 2;
  26. if(T > MAXIMUM_TEMPERATURE)
  27. T = T - 1;
  28. end
  29.  
  30. end
  31.  
  32. disp(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement