Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = input('Enter an input value for a:');
- b = input('Enter an input value for b:');
- c = input('Enter an input value for c:');
- d = input('Enter an input value for d:');
- MINIMUM_TEMPERATURE = input('Enter minimum temperature :');
- MAXIMUM_TEMPERATURE = input('Enter maximum temperature :');
- temp_m = MINIMUM_TEMPERATURE;
- temp_max = MAXIMUM_TEMPERATURE;
- count = 0;
- while(temp_m <= MAXIMUM_TEMPERATURE)
- count = count + 1;
- temp_m = temp_m + 2;
- if(temp_m > MAXIMUM_TEMPERATURE)
- count = count + 1;
- end
- end
- res = zeros(count,2);
- T = MINIMUM_TEMPERATURE;
- for j = 1:count
- cap = a + (b * T) + (c * power(T,2)) + (d * power(T,3));
- res(j,1)= T;
- res(j,2)= cap;
- T = T + 2;
- if(T > MAXIMUM_TEMPERATURE)
- T = T - 1;
- end
- end
- disp(res);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement