Professional Documents
Culture Documents
Fall 2020
Lab Session-6
1. The energy (E) required to heat water at constant pressure is approximately equal to
E=mC p DT
a) Create an anonymous function called heat to find the energy required to heat 1 g of
water if the change in temperature is provided as the input. Then, create another
anonymous function cal_to_J to convert your answer into joules. Note that 1 cal = 4.2
J. Test your anonymous functions in a single command line for deltaT=20 K.
b) Finally, use fplot to plot E (in cal) vs. T for temperature changes within the range 0
C to 100 C. Include a title and labels to your graph.
2. Create function handlers for the following functions and plot them using fplot.
1 −z /2 2
(
cos (t )
b) x=sin (t) e −2 cos ( 4 t )−sin( 12t ))
5
t
y=cos(t )( e −2 cos ( 4 t )−sin ( ))
cos(t) 5
12
on the same graph from t=0 to 100. Plot the function (y) with cyan dotted lines. Add axes
labels and a legend.
3. The average daily temperature for an area can be approximated by the following
function:
Where Tmean = the average annual temperature, Tpeak = the peak temperature, w= the
frequency of the annual variation (=2π/365), and tpeak= day of the peak temperature (≅
205 d). Parameters for some cities are listed here:
4. Use your favorite Internet search engine and World Wide Web browser to identify recent
currency conversions for Turkish lira, Japanese yen, and the European euro to US dollars.
Write a function M-file to create the conversion table described below. Use the disp and
fprintf commands in your solution, which should include a title, column labels, and
formatted output.
The table must be composed of four columns. The first should contain dollars, the second
the equivalent number of euros, the third the equivalent number of liras, and the fourth the
equivalent number of yens.