Home /
Expert Answers /
Computer Science /
please-use-easiest-code-matlab-please-20-points-problem-3-use-input-command-a-while-loop-for-e-pa668
(Solved): please use easiest code, matlab please (20 points) Problem 3 (Use input command, a while loop for e ...
please use easiest code, matlab please
(20 points) Problem 3 (Use input command, a while loop for error message and output command fprintf) The speed of a sound wave is affected by the temperature of the air. At 0∘C, the speed of a sound wave is 331m/sec. The speed increases by approximately 0.8m/sec for every degree (in Celsius) above 0 ; this is a reasonably accurate approximation for 0−80 degrees C. So, our equation for the speed in terms of a temperature C is: speed =331+0.8∗C Write a user defined function "soundtemp" that will prompt the user for a temperature in Celsius in the range from 0 to 80 inclusive and will calculate and print the speed of sound at that temperature. If the user enters a temperature in that range, or an error message if not. The format of the input and output messages are given below: % User prompt input Enter a temp in the range 0 to 80:XX% If user enter a number below 0 or higher than 80 then display the below error message Error in temperature. Try a different number. % Display output For a temperature of XX, the speed is XX.XX