Question: USE MATLAB Write a script program that addresses the following: ( a ) Assign the data for distance and amplitude to column vector variables x
USE MATLAB
Write a script program that addresses the following:
a Assign the data for distance and amplitude to column vector variables x and y respectively.
b Take the natural logarithm of the amplitude data and assign to the variable yp
c Assuming a linear fit model, use the polyfit command on the yp vs x data to find the bestfit values m and b in yp mx b Compute the predicted values for this model and assign to variable yplinear.
i Use fprintf to display these values with a message that they were obtained using polyfit.
d Create a plot of the linearized amplitude yp vs distance data x as blue circle points In the same figure, plot the predicted amplitude yplinear vs distance data x as a dashed red line
i Label the horizontal axis as Distance and vertical axis as Natural Log Amplitude
ii Add a title to the figure as Linearized Sound Amplitude Plot
iiiAdd a legend to the figure with labels Linearized data and Linear fit respectively.
e Assuming an exponential fit model, use the found values m and b in part d to determine the values a and c in y aecx Compute the predicted values for this model and assign to variable ypexp.
i Use fprintf to display these values with a message that they were obtained from m and b
f Create a second plot of the original amplitude y vs distance data x as blue asterisk points In the same figure, plot the predicted amplitude ypexp vs distance data x as a solid red line
i Label the horizontal axis as Distance and vertical axis as Amplitude
ii Add a title to the figure as Sound Amplitude Plot
iiiAdd a legend to the figure with labels Original data and Exponential fit respectively.
g Use the exponential fit model to predict the sound amplitude at a distance of x
i Use fprintf to display a message with the amplitude value predicted at this distance
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
