[ad_1]
Part I: Matrix multiplication and ordering of elements1) HerewehavematrixA=”2 4′,B= “−1 2’365 2Calculate the following: A*B=A.*B=4 9 112) MatrixA=,3 7 5 1 ,usingalltheelementsofA,2168 10 12a) Reshape matrix A to a new matrix, named B1 with two rows and six columns. Please write down the MATLAB command, and write down matrix B1.>> B1=b) Reshape matrix A to a new matrix, named B2 with six rows and two columns. >>B2=B*A= B.*A=Part II: Relational and logical operatorsIn recent weeks, you’ve heard about the hurricanes, for example, Hurricane Florence. The so-called Saffir-Simpson Hurricane Wind Scale is a 1 to 5 rating based on a hurricane’s sustained wind speed. This scale estimates potential property damage. See the below Hurricane category table, adapted from National Hurricane Center, http://www.nhc.noaa.gov/aboutsshws.php . Use the MATLAB relational and logical operators (hint: if-elseif-else statement) to write a MATLAB code file (.m) to determine for a given wind speed of a hurricane, which category the hurricane is and what damage has. You need to first name a variable, “WindSpeed” to denote the wind speed, a variable “HurricaneCategory” and a variable named “Damage” to denote the category (from 1 to 5) and denote damage at landfall (listed in the table). Refer to Lecture Note 05.You can copy/paste your codes here. Or print and attach the file you wrote.CategoryWind speed (mph) Damage at landfall 174-95Minimal296-110 Moderate3111-129 Extensive 4130-156Extreme5>=157 Catastrophic Part III: Plotting of EquationsOne of the reasons that so many scientists (including geoscientists) use MATLAB is because of its built-in plotting functions. Thus, with MATLAB, you can do mathematical calculations and visualize the results all in a single, easy-to-use language. You may start the first MATLAB script that plots a basic equation.1) Here we first use the conversion from Fahrenheit to Celsius as one example. Follow the instructions below. Please include comments for the lines you wrote.a) Create a new MATLAB script (TempConvertF2C.m) in your directory (either Q: if you are using UMKC remote lab, or any directory you may prefer). In the first few comment lines, include your name, your UMKC ID, and the date you created the code.b) The temperature T in degrees Celsius (°C) is equal to the temperature T in degrees Fahrenheit (°F) minus 32, times 5/9:C = (F- 32) × 5/9Copy/paste the MATLAB script that plots this equation.Run your code (give a value to F) in MATLAB to fill out the following table.0 °F°C70 °F°C100 °F °C3GEOG 444 Lab Assignment #2:2) Let’s move on and look at a relatively complex example and do some plotting as well. a) The general form of a sinusoid with an amplitude, A, and a wavelength, λ is given by:b) Write a MATLAB script that plots this equation for a single wavelengths and amplitude. Some guidance is provided below.c) Remember that MATLAB can’t plot equations. It can only plot data, so you will have to first make the data before you can plot anything. The first step is to make variables for A, x, y, and λ. Set the amplitude A to 2 and the wavelength λ to 24. Make your independent variable, x, go from 0 ≤ x≤ 3λ and have 1,000 total data points. When making your data, make sure to use an efficient MATLAB command (hint: “linspace”, please check our lecture notes or “help linspace” in MATLAB) for generating a large list of numbers.d) Now, that you have x-values stored (hopefully in a variable/vector called “x”), you can now use the sinusoidal equation given above to calculate the y-values. Store these in a variable/vector called “y”. Note that “x” and “y” should have the same dimensions if you did everything correctly.e) Now that you have your x and y data all created, make a plot of the results. Put x as the x-axis, and y as the y- axis. In your plot, use the following formatting:o The equation should be plotted with a dashed green lineo The x-axis should be labeled “Time (hours)”o The y-axis should be labeled “Temperature Change (Degree C)”o The plot should have the following axis ranges, for the x-axis: 0 ≤ x ≤ 3λ; and forthe y-axis: -1.2A ≤ y ≤ 1.2A and the appropriate formatting command should only directly reference your A and λ variables. This makes your code more general and easier to modify for different amplitudes or wavelengths.Please copy/paste your MATLAB script here. And save your plotting as a .png file and copy it here or attach it.Part IV: Plotting data, subplotting and save plottingMATLAB is also very good at handling numerical data (even when the quantity of data is super large, which is true for Geosciences data).1) SubplottingIn this example, you’ll read the data and do multiple plotting in the same figure to draw the climograph of Kansas City, i.e., the long-term monthly (from January to December) mean of surface air temperature and precipitation separately. Follow the instructions below.a) The following table shows you three columns, first column: calendar month from January to December; second column: surface air temperature for each month (unit: F); third column: precipitation accumulated for each month (unit: inch).1 29.3 1.13 2 35.2 1.02 3 45.9 2.38 4 56.5 3.27 5 66.6 4.55 6 76.1 4.73 7 81.3 3.61 8 79.5 3.62 9 70.6 4.17 10 59.0 3.28 11 44.8 2.30 12 33.6 1.45b) First save the above data into a file named KCdata.txtc) Read the above data in MATLAB (hint: using load command), then define three variables: month, temperature, precipitation and read each column of the variable KCdata (Here you may use the command “whos KCdata” to see the dimension, which should be 12*3). Now you have all the three variables created and values stored.d) make a plot with two subplot.The upper panel should be a line plot, showing the annual cycle of the temperature, with x-axis as calendar month and y-axis as the temperature. In this plot, use the following formatting:o The plot should be plotted with a solid red lineo The x-axis should be labeled “Months”o The y-axis should be labeled “Temperature (Degree F)”o Title should be “KC Temperature”The lower panel should be a bar graph, showing the annual cycle of the precipitation, with x-axis as calendar month and y-axis as the precipitation. In this plot, use the following formatting:o The plot should be plotted with a bar graph.o The x-axis should be labeled “Months”o The y-axis should be labeled “Precipitation (inch)”o Title should be “KC Precipitation”Please copy/paste your MATLAB script here or attach it. And save your plotting as a .png file and insert it here or attach it.2) Multiple plotting using the same axisIn this example, you’ll read the data and do multiple plotting using the same axis to draw the monthly (from January to December) mean surface air temperature for New York City and San Francisco in the same figure. This type of figure is normally used for comparison purpose. Follow the instructions below.a) The following table shows you three columns, first column: calendar month from January to December; second column: surface air temperature for each month (unit: F) for New York City; third column: same as the second column but for San Francisco.1 32.6 49.4 2 34.8 52.4 3 42.3 54 4 52.2 56.2 5 62.4 58.7 6 71.5 61.4 7 77.1 62.8 8 75.9 63.6 9 68.6 63.9 10 57.7 61 11 47.6 54.7 12 37.9 49.5b) First save the above data into a file named Temp_NYC_SFO.txtc) Read the above data in MATLAB (hint: using load command), then define three variables: month, temperature at NYC, and temperature at SFO and read each column of the variable Temp_NYC_SFO. Now you have all the three variables created and values stored.d) make a plot with annual cycle of temperatures at NYC and SFO at the same axis, with x-axis as calendar month and y-axis as the temperature. In this plot, use the following formatting:o NYC should be plotted with a solid red line with marker “circle”, blue edge color, magenta face color, marker size 4. SFO with a dashed green line with marker “diamond”, black edge color, cyan face color, marker size 8.o The x-axis should be labeled “Months”o The y-axis should be labeled “Temperature (Degree F)”o Title should be “NYC vs. SFO”o Put a legend on top left corner to present “NYC” and “SFO”o With grids lineso The x-axis limit should be set from 0.5 to 12.5 and y-axis limit should be set from 25to 80 F.o Bonus: Display tick marks along the x-axis at the values 1, 2, …, 12. Then specify alabel for each tick mark as Jan, Feb, …, Dec (3-letter abbreviation for each month).Please copy/paste your MATLAB script here or attach it. And save your plotting as a .png file and insert it here or attach it.
What Students Are Saying About Us
.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐"Honestly, I was afraid to send my paper to you, but splendidwritings.com proved they are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"
.......... Customer ID: 14***| Rating: ⭐⭐⭐⭐⭐
"The company has some nice prices and good content. I ordered a term paper here and got a very good one. I'll keep ordering from this website."