# ch2note3 - StillMoreonChapter2 SomeProblemExamples...

This preview shows pages 1–5. Sign up to view the full content.

Still More on Chapter 2 Some Problem Examples

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Some Problems Lets use what we know about  Matlab to solve some relatively  simple problems.
A Problem About Temperature  Conversions (1) Problem 1: Write a program that converts  Fahrenheit to Celsius. The program  should explain to the user what program  is, what it does, ask the user for a  temperature in Fahrenheit, then print  out the converted temperature.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
A Problem About Temperature  Conversions (2) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Prof Newman % EGR 115 - FXX - Section Y % Class Example % % Purpose - Converts a user supplied temp in F and converts it to C % fprintf( 'This program will convert the temperature in F\n' ); fprintf( 'and convert it to the corresponding temperature\n' ); fprintf( 'in C.\n\n' ); temp_f = input( ' Input the temperature in F: ' ); temp_c = (5/9)*(temp_f - 32); fprintf( ' The corresponding temperature is %g C\n' , temp_c) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/13/2010 for the course EGR EGR115 taught by Professor Newman during the Spring '10 term at Embry-Riddle FL/AZ.

### Page1 / 8

ch2note3 - StillMoreonChapter2 SomeProblemExamples...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online