ES115 - Homework and Notes - Set

Assigned: Monday, Oct. 3, 2011
Due in class: Monday, Oct. 10, 2011

Useful References

For each function, have a comment block at the top with the file name, your name, the exercise number, and the date.  In MATLAB, to copy the interactive session, first open a new file (File => New => Script).  Next, use the mouse the highlight the text, right click and select 'copy'.  Finally, in the new window paste in the text (Edit => Paste).  Save your files in a folder and save the contents to a compressed file hwkx.zip

Homework Problems

  1. The area of a triangle is b*h/2 where b and h are the base and height, respectively.  Write a function 'triangle(bh)' where bh is a two dimensional array.  The first and second columns are base and height values, with each row corresponding to a triangle.  The function returns the area of the triangles in a column vector.
    1. Produce your funtion triangle.m
    2. Consider triagles with base and height values given as ordered pairs: (1,2), (2,3), (3,4), (4,5).  Use the function interactively, demonstrating how you used the function interactively.  Copy your results into 'triangle.txt'
  2. Ex 6.10 - Part (c) only.  Conider centigrade temperatures 0, 10, 20, and so, ending at 100oC.  As in the first exercise, demonstrate how you used the function.  Copy your interactive results into 'C_to_F.txt'

  3. Ex 6.3 - As in the first exercise, demonstrate how you used the function.  Copy your interactive results into 'future_value.txt'

  4. Ex 6.4 As in the first exercise, demonstrate how you used the function.  Copy your interactive results into 'nmoles.txt'



Written by Jonathan Hill for ES115 - Computer Applications
CETA - University of Hartford, USA
Revision Date: Oct. 2, 2011, 6:30PM