Question
CIE 115 Lab 11 Page 1 of 2 COASTAL ENGINEERING You are working for a coastal engineering company that is tracking sediment transport in an
CIE 115 Lab 11 Page 1 of 2 COASTAL ENGINEERING You are working for a coastal engineering company that is tracking sediment transport in an estuary. The flows (velocity) in the estuary will tell you how the sediment is being transported. You are provided with data from a field research company and need to process it in matlab to present to a client who needs this information. The .mat files are provided and described below. V ? A 3D matrix of velocity, m/s Y ? A 2D matrix of depth values that correspond to the velocity matrix, m X ? A vector of distance values that correspond to the velocity matrix, km n ? A vector of water heights, m b ? A vector of bathymetry heights, m t ? A vector of time, hours 1. Download the .mat file holding all of the variables and load it into your script using the load command. 2. Create a figure that plots the time averaged velocity as a filled contour. The contour should not have a line style and should have a jet colormap. On the same graph, plot the bathymetry as a solid black line with a width of 2. Make sure to label your x and y axis as well as your colorbar (colorbar should only have units as a label). Make the font size 14. 3. Create a second figure that plots the wave height (n) and the distance averaged and depth averaged velocity on the same plot. Use yyaxis to plot both vectors. Wave height should be plotted on the right in red, and velocity on the left in blue. Make sure to label both y axes as well as your x axis. Make the font size 14 and set the x axis plotting limit to [6 17] km. 4. Print both your plots and submit a PDF with the script and both plots. NOTE: The first dimension in the 3D matrix V is depth, the second dimension is distance, and the third dimension is time. Use squeeze command to help compact a 3D matrix into a 1D or 2D matrix. CIE 115 Lab 11 Page 2 of 2 Challenges: ?Smooth out your contour by adding more contour intervals (+5) ?For the first plot, plot a white line where the velocities are 0 m/s, make the line dashed and of width 2. (+5) Hint: dont plot a line, plot another contour. ?For the second plot, make sure both y axes are the same and plot a straight black line that goes along y=0 (+5). Index Challenge (+ 15) 1. Create a 30x40 matrix of random numbers 2. Set the entire 10th column and the entire 20th column equal to 2 3. Set the matrix defined by the 14th to 16th row and the 10th to 20th column equal to 2 4. Set the first half of the 30th column equal to 2 5. Plot a filled contour of A (you do not need an x or y or any labels) To get full credit submit your code (you can put it at the end of your lab) as well as your graph. Index Challenge (+15) ALL OR NOTHING YOU MUST SHOW EITHER RACHEL OR NEIL YOUR ANSWERS AND BE ABLE TO EXPLAIN HOW YOU GET THEM! THESE ARE HAND-WRITTEN ANSWERS. A is a matrix: B is a matrix (depth by time): 2 7 9 56 89 3 6 5 54 89 45 8 5 15 54 4 8 8 1 3 7 9 44 4 1. A(4:6,4) 2. What is the size of A? 3. size(A,1) 4. D=A( : ,3); what kind of data set is D? (matrix, row vector, column vector, scalar) 5. I want to take a depth-average of B. What is the code to do this? 6. What is the size of the depth-average of B and what kind of data set is it? 1 7 9 56 NaN 5 7 9 1 3 7 1 2 36 4 NaN 789 1 6 43 2 4 0 2 798 13 1 5 4 3 47 1 2 8 9 45 3 1 78 0 26 7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started