Output Max and Min values
1 view (last 30 days)
Show older comments
So I am wrote a code that has a user input a certain temperature, either in Celsius or Fahrenheit, then outputs the temperature in C, K, R, and F and then says if it is hot, cold, boiling based on the Celsius temperature. So, now I need to put the code in a while loop and it has to now output the previous stuff, as well as the Average temperature for each trial, and the Max and Min of the trial temperatures (in C). I am really lost on how to solve this and would love any help you can give
3 Comments
dpb
on 13 Mar 2014
Then you must save the max and min values you find (the first time they'll be the same as the trial, obviously) as a new variable. On subsequent trials you would then compare the new value to the save previous max/min variables and only replace if the new exceeds the stored value.
For looping, see
doc while
My recollection is there's an example there that is repeated user input??? Or, is that on the input help? Anyway, there's examples enough of the various pieces to get a good start.
Since this sounds awfully lot like homework and we don't do homework straight out, post your efforts and ask more specific questions where you get stuck.
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!