Spring 09 WS 25

# Spring 09 WS 25 - ENG EK 127 Spring 2009 Worksheet 25 Name...

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

ENG EK 127 Spring 2009 Worksheet 25 Name: ____________________________________________ Instructions: Spend the entire class period studying for the exam on Friday. Make sure that you have done all worksheet problems and that your notes are complete and easy for you to understand. You will receive full credit for the attendance only for spending the entire class period doing these problems and studying; you may not leave early without having points deducted. 1. The velocity of sound in air is 49.02 T feet per second where T is the air temperature in degrees Rankine. Write an M-file function to implement this. If just one argument is passed to the function, it is assumed to be the air temperature in degrees Rankine. If, however, two arguments are passed, the two arguments would be first an air temperature and then a character ‘f’ for Fahrenheit or ‘c’ for Celsius (so you would then have to convert to Rankine). Note: degrees R = degrees F + 459.67. Degrees F = 9/5 degrees C + 32. function velocity = velocityair(temp, varargin) n = nargin; if n ==2 unit = varargin{1}; if unit == 'f' temp = temp + 459.67; end if unit == 'c' temp = (9/5)*temp+32+459.67; end end velocity = 49.02*sqrt(temp); 2. Write a function “matmult” that will receive two matrix arguments. The function will ask the user whether the two matrices should be multiplied (e.g., matrix multiplication) or multiplied term-by-term. Make sure that the matrices are the correct size(s) for the requested operation. The function should print an error message if the sizes are not correct. Otherwise, the function should return (as an

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Spring 09 WS 25 - ENG EK 127 Spring 2009 Worksheet 25 Name...

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

View Full Document
Ask a homework question - tutors are online