Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use only matlab. Numerical method No results | Options v in ME4053 to measure the speed of owing data (next page) was t sound. The
Use only matlab. Numerical method
No results | Options v in ME4053 to measure the speed of owing data (next page) was t sound. The first column gives the distance between the speaker and the microphone (in meters) and the second column gives the measured time-delay between when a signal is sent to the speaker and when the signal reaches the microphone (in milliseconds). (a) Plot the data with the range on the x-axis and the time delay on the y-axis. (b) Perform a linear regression on the data. Plot the straight line on the same plot as part (a). Use the formula for the linear regression coefficients that we derived in class. Name your Matlab code "MyLinearRegression.m" (c) Calculate the speed of sound by taking the inverse of the slope of you linear regression line Express your answer in meters per second Time Range (m) 0.02 0.04 0.06 0.08 0.25 0.30 O 40) 0.50 0.55 o.Go 0.66 0.69 0.71 0.14 0. 16 0.18 (d) Repeat part (b) but compute instead the linear regression coefficients using the built-n Matlab function "polyfit m HINT #1 : Type in the prompt commande line " help polyfit " to see how to use this function. HINT #2 A linear fit correspond to fitting a polynom of degree 1 to the data (ie. in the form a*x+b, where a and b are the polynom coefficients that polyfit m will give you). (e) Using the command polyval.m use the results of the polyfit m" command to adda dashed line corresponding to the best linear fit you just determined with Matlab on the same plot as part (a &b) NameyourMatlab code for Part (d) and (e) nly PaymentStep 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