CSC115: Matlab Special Session
description
Transcript of CSC115: Matlab Special Session
![Page 1: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/1.jpg)
CSC115: Matlab Special SessionDr. Zhen JiangComputer Science DepartmentWest Chester University
![Page 2: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/2.jpg)
P399, changing argument orderP401, linestyles, markers, and
colorsP402, labelP404, Axes limitP408, multiple plots
![Page 3: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/3.jpg)
Display the monthly (12 months) snowfall records for the city that have the longest snow season (most months have snowfall).
![Page 4: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/4.jpg)
![Page 5: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/5.jpg)
Display the monthly (12 months) temperature for the hottest city (one record is enough, no need for the solution for tie) and the coldest city (different curve/line) in one plot graph.
![Page 6: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/6.jpg)
![Page 7: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/7.jpg)
Display the average of temperature, # of sunny days, and # of rainy days in each month (3 curves/lines) in United States in one plot graph.
![Page 8: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/8.jpg)
![Page 9: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/9.jpg)
Display the monthly (12 months) temperature for the hottest city (one record is enough, no need for the solution for tie) in summer (June, July, & August) and the coldest city in winter (December, January, and February) in one plot graph (2 curves).
![Page 10: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/10.jpg)
![Page 11: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/11.jpg)
Display the monthly (12 months) temperature for the top 5 hotest cities that have the average (year) temperature in 50’s (>= 50 and <60) in one plot graph (five curves).
![Page 12: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/12.jpg)
![Page 13: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/13.jpg)
![Page 14: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/14.jpg)
Page 431, Figure 27.4, meshPage 432, Figure 27.6, meshz
![Page 15: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/15.jpg)
![Page 16: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/16.jpg)
Page 434, Figure 27.9, surf
![Page 17: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/17.jpg)
![Page 18: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/18.jpg)
What is X?What is Y?What is Z?
![Page 19: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/19.jpg)
Make your own X, YDetermine the corresponding Z
![Page 20: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/20.jpg)
![Page 21: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/21.jpg)
Find the distance from (i, j) to (dx(1), dy(1)), the first city in record.
min_d2 = (dx(1)-(i-1+minx))*(dx(1)-(i-1+minx)) + (dy(1)-(j-1+miny))*(dy(1)-(j-1+miny));
Set the current closest city index => 1st
id = 1; Find the kth city from city2 to the
city_num-th city in the record◦Check the distance from (i,j) to (dx(k), dy(k))
if it can beat the record min_d2◦If yes, update id=k
update z(j,i) = dz(id);
![Page 22: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/22.jpg)
![Page 23: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/23.jpg)
Page 436, Figure 27.12, nan
![Page 24: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/24.jpg)
![Page 25: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/25.jpg)
Page 437, figure 27.13, surfl
![Page 26: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/26.jpg)
![Page 27: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/27.jpg)
Page 438, figure 27.15, sufnorm
![Page 28: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/28.jpg)
![Page 29: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/29.jpg)
view
![Page 30: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/30.jpg)
![Page 31: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/31.jpg)
Making your picture on slide 12 rotating?
![Page 32: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/32.jpg)
Stem3
![Page 33: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/33.jpg)
![Page 34: CSC115: Matlab Special Session](https://reader036.fdocuments.in/reader036/viewer/2022062310/568160c4550346895dcff1d3/html5/thumbnails/34.jpg)
Chapter 28, page 461-476